PythonExtra/tests/micropython/decorator_error.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
282 B
Python
Raw Normal View History

# test syntax errors for uPy-specific decorators
def test_syntax(code):
try:
exec(code)
except SyntaxError:
print("SyntaxError")
# invalid micropython decorators
test_syntax("@micropython.a\ndef f(): pass")
test_syntax("@micropython.a.b\ndef f(): pass")