def test_encoding(self):
with temp_dir() as script_dir:
filename = os.path.join(script_dir, 'script.py')
with open(filename, 'w', encoding='latin1') as f:
f.write("""
#coding:latin1
"non-ASCII: h\xe9"
""")
result = run_path(filename)
self.assertEqual(result['__doc__'], "non-ASCII: h\xe9")
评论列表
文章目录