summaryrefslogtreecommitdiff
path: root/tests/micropython/decorator_error.py
blob: 94772ac1e5fef0b0154b17e95cdb972ed4507d63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# 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")