MCPcopy Create free account
hub / github.com/ipython/ipython / test_read_file

Function test_read_file

IPython/utils/tests/test_openpy.py:17–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16
17def test_read_file():
18 with io.open(nonascii_path, encoding="iso-8859-5") as f:
19 read_specified_enc = f.read()
20 read_detected_enc = openpy.read_py_file(nonascii_path, skip_encoding_cookie=False)
21 nt.assert_equal(read_detected_enc, read_specified_enc)
22 assert "coding: iso-8859-5" in read_detected_enc
23
24 read_strip_enc_cookie = openpy.read_py_file(
25 nonascii_path, skip_encoding_cookie=True
26 )
27 assert "coding: iso-8859-5" not in read_strip_enc_cookie
28
29
30def test_source_to_unicode():

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected