diff options
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r-- | Lib/test/test_syntax.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index b09e524a756..c52d2421941 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -2872,6 +2872,13 @@ class SyntaxErrorTestCase(unittest.TestCase): """ self._check_error(source, "parameter and nonlocal", lineno=3) + def test_raise_from_error_message(self): + source = """if 1: + raise AssertionError() from None + print(1,,2) + """ + self._check_error(source, "invalid syntax", lineno=3) + def test_yield_outside_function(self): self._check_error("if 0: yield", "outside function") self._check_error("if 0: yield\nelse: x=1", "outside function") |