MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_encoding

Method test_encoding

Lib/test/test_runpy.py:755–764  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

753 self.assertRaises(RecursionError, run_path, zip_name)
754
755 def test_encoding(self):
756 with temp_dir() as script_dir:
757 filename = os.path.join(script_dir, 'script.py')
758 with open(filename, 'w', encoding='latin1') as f:
759 f.write("""
760#coding:latin1
761s = "non-ASCII: h\xe9"
762""")
763 result = run_path(filename)
764 self.assertEqual(result['s'], "non-ASCII: h\xe9")
765
766
767@force_not_colorized_test_class

Callers

nothing calls this directly

Calls 6

temp_dirFunction · 0.90
run_pathFunction · 0.90
openFunction · 0.50
joinMethod · 0.45
writeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected