cpython: 96cdd2532034 (original) (raw)
Mercurial > cpython
changeset 99012:96cdd2532034
Issue #24802: Merge ValueError test case from 3.5 [#24802]
Martin Panter vadmium+py@gmail.com | |
---|---|
date | Sun, 08 Nov 2015 11:09:37 +0000 |
parents | 7368b86432c6(current diff)a13d9656f954(diff) |
children | aca512f451a8 |
files | |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-)[+] [-] Lib/test/test_compile.py 5 |
line wrap: on
line diff
--- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -545,10 +545,9 @@ if 1: 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[](#l1.7)
with self.assertRaisesRegex(Exception, "cannot contain null"):[](#l1.8)
with self.assertRaisesRegex(ValueError, "cannot contain null"):[](#l1.9) compile("123\x00", "<dummy>", "eval")[](#l1.10)
with self.assertRaisesRegex(Exception, "cannot contain null"):[](#l1.11)
with self.assertRaisesRegex(ValueError, "cannot contain null"):[](#l1.12) compile(memoryview(b"123\x00"), "<dummy>", "eval")[](#l1.13) code = compile(memoryview(b"123\x00")[1:-1], "<dummy>", "eval")[](#l1.14) self.assertEqual(eval(code), 23)[](#l1.15)