MCPcopy Index your code
hub / github.com/python/cpython / test_encoding

Method test_encoding

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

Source from the content-addressed store, hash-verified

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

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