You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
214179b430
This is intended to improve coverage of the test suite.
14 lines
290 B
Python
14 lines
290 B
Python
# make sure syntax error works correctly for bad const definition
|
|
|
|
def test_syntax(code):
|
|
try:
|
|
exec(code)
|
|
except SyntaxError:
|
|
print("SyntaxError")
|
|
|
|
# argument not a constant
|
|
test_syntax("a = const(x)")
|
|
|
|
# redefined constant
|
|
test_syntax("A = const(1); A = const(2)")
|