PythonExtra/tests/basics/op_error_literal.py
Damien George 025e4b6fbc tests/basics: Split out literal tests that raise SyntaxWarning on CPy.
Fixes issue #7330.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-30 13:41:37 +10:00

19 lines
339 B
Python

# test errors from bad operations with literals
# these raise a SyntaxWarning in CPython; see https://bugs.python.org/issue15248
# unsupported subscription
try:
1[0]
except TypeError:
print("TypeError")
try:
""[""]
except TypeError:
print("TypeError")
# not callable
try:
1()
except TypeError:
print("TypeError")