diff options
| author | Florent Xicluna <florent.xicluna@gmail.com> | 2012-07-07 12:13:35 +0200 |
|---|---|---|
| committer | Florent Xicluna <florent.xicluna@gmail.com> | 2012-07-07 12:13:35 +0200 |
| commit | 11f0b41e9de3805441ddd4142df9f6b7f4432ca7 (patch) | |
| tree | d32d9eadffd3f5a787bafad084d7bd639ec0eff3 /Lib/test/test_tokenize.py | |
| parent | 9235b254dcad979abe36be1024f8e89b04c764be (diff) | |
| download | cpython-git-11f0b41e9de3805441ddd4142df9f6b7f4432ca7.tar.gz | |
Issue #14990: tokenize: correctly fail with SyntaxError on invalid encoding declaration.
Diffstat (limited to 'Lib/test/test_tokenize.py')
| -rw-r--r-- | Lib/test/test_tokenize.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index 63d084df73..b6a9ca1e16 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -674,6 +674,10 @@ class TestTokenizerAdheresToPep0263(TestCase): f = 'tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt' self.assertTrue(self._testFile(f)) + def test_bad_coding_cookie(self): + self.assertRaises(SyntaxError, self._testFile, 'bad_coding.py') + self.assertRaises(SyntaxError, self._testFile, 'bad_coding2.py') + class Test_Tokenize(TestCase): |
