[Python-checkins] cpython (3.5): Issue #24802: Update test case for ValueError in 3.5

martin.panter python-checkins at python.org
Sun Nov 8 06:30:42 EST 2015


https://hg.python.org/cpython/rev/a13d9656f954
changeset:   99011:a13d9656f954
branch:      3.5
parent:      99009:d13263ecf0c6
user:        Martin Panter <vadmium+py at gmail.com>
date:        Sun Nov 08 11:09:13 2015 +0000
summary:
  Issue #24802: Update test case for ValueError in 3.5

files:
  Lib/test/test_compile.py |  5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)


diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -545,10 +545,9 @@
     def test_null_terminated(self):
         # The source code is null-terminated internally, but bytes-like
         # objects are accepted, which could be not terminated.
-        # Exception changed from TypeError to ValueError in 3.5
-        with self.assertRaisesRegex(Exception, "cannot contain null"):
+        with self.assertRaisesRegex(ValueError, "cannot contain null"):
             compile("123\x00", "<dummy>", "eval")
-        with self.assertRaisesRegex(Exception, "cannot contain null"):
+        with self.assertRaisesRegex(ValueError, "cannot contain null"):
             compile(memoryview(b"123\x00"), "<dummy>", "eval")
         code = compile(memoryview(b"123\x00")[1:-1], "<dummy>", "eval")
         self.assertEqual(eval(code), 23)

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list