| 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 |
| 762 | s = "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' |