diff options
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/bad_coding3.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_pep263.py | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/bad_coding3.py b/Lib/test/bad_coding3.py new file mode 100644 index 0000000..77836d9 --- /dev/null +++ b/Lib/test/bad_coding3.py @@ -0,0 +1,2 @@ +# coding: string-escape +\x70\x72\x69\x6e\x74\x20\x32\x2b\x32\x0a diff --git a/Lib/test/test_pep263.py b/Lib/test/test_pep263.py index 4b60624..a3abc3c 100644 --- a/Lib/test/test_pep263.py +++ b/Lib/test/test_pep263.py @@ -58,6 +58,11 @@ class PEP263Test(unittest.TestCase): with self.assertRaisesRegexp(SyntaxError, 'BOM'): compile('\xef\xbb\xbf# -*- coding: fake -*-\n', 'dummy', 'exec') + def test_non_unicode_codec(self): + with self.assertRaisesRegexp(SyntaxError, + 'codec did not return a unicode'): + from test import bad_coding3 + def test_main(): test_support.run_unittest(PEP263Test) |
