(parse_stmt, exec_stmt=None)
| 1 | from testutils import assert_raises |
| 2 | |
| 3 | def raisesSyntaxError(parse_stmt, exec_stmt=None): |
| 4 | with assert_raises(SyntaxError): |
| 5 | compile(parse_stmt, '<test>', 'exec') |
| 6 | if exec_stmt is not None: |
| 7 | source = "\n".join([parse_stmt, exec_stmt]) |
| 8 | exec(source) |
| 9 | |
| 10 | # Check that errors are raised during parsing. |
| 11 | raisesSyntaxError("def f(**__debug__): pass") |
no test coverage detected