diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-02-04 08:53:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-04 08:53:48 (GMT) |
commit | 07ca9afaa8768b44baf816b4998d209ed3e0088f (patch) | |
tree | acb09f5cd6a660acb41d77c150cdd6236bf02d96 /Lib/test/support | |
parent | 8b5fa289fdb04b6b919cf95fa99246aa872e47a8 (diff) | |
download | cpython-07ca9afaa8768b44baf816b4998d209ed3e0088f.zip cpython-07ca9afaa8768b44baf816b4998d209ed3e0088f.tar.gz cpython-07ca9afaa8768b44baf816b4998d209ed3e0088f.tar.bz2 |
bpo-10544: Disallow "yield" in comprehensions and generator expressions. (GH-4564)
Diffstat (limited to 'Lib/test/support')
-rw-r--r-- | Lib/test/support/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 22868d4..6c9e31a 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1061,8 +1061,8 @@ def make_bad_fd(): file.close() unlink(TESTFN) -def check_syntax_error(testcase, statement, *, lineno=None, offset=None): - with testcase.assertRaises(SyntaxError) as cm: +def check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=None): + with testcase.assertRaisesRegex(SyntaxError, errtext) as cm: compile(statement, '<test string>', 'exec') err = cm.exception testcase.assertIsNotNone(err.lineno) |