Files
RustPython/tests/snippets/invalid_syntax.py
2019-04-17 20:02:24 +02:00

17 lines
205 B
Python

src = """
def valid_func():
pass
yield 2
"""
try:
compile(src, 'test.py', 'exec')
except SyntaxError as ex:
assert ex.lineno == 5
else:
raise AssertionError("Must throw syntax error")