summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tokenize.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2012-07-07 10:13:35 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2012-07-07 10:13:35 (GMT)
commit11f0b41e9de3805441ddd4142df9f6b7f4432ca7 (patch)
treed32d9eadffd3f5a787bafad084d7bd639ec0eff3 /Lib/test/test_tokenize.py
parent9235b254dcad979abe36be1024f8e89b04c764be (diff)
downloadcpython-11f0b41e9de3805441ddd4142df9f6b7f4432ca7.zip
cpython-11f0b41e9de3805441ddd4142df9f6b7f4432ca7.tar.gz
cpython-11f0b41e9de3805441ddd4142df9f6b7f4432ca7.tar.bz2
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.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py
index 63d084d..b6a9ca1 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):