summaryrefslogtreecommitdiff
path: root/tests/basics/op_error_literal.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/op_error_literal.py')
-rw-r--r--tests/basics/op_error_literal.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/basics/op_error_literal.py b/tests/basics/op_error_literal.py
new file mode 100644
index 000000000..00244ee2b
--- /dev/null
+++ b/tests/basics/op_error_literal.py
@@ -0,0 +1,18 @@
+# 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")