summaryrefslogtreecommitdiff
path: root/tests/basics/fun_error2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/fun_error2.py')
-rw-r--r--tests/basics/fun_error2.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/basics/fun_error2.py b/tests/basics/fun_error2.py
new file mode 100644
index 000000000..c4d2c0b64
--- /dev/null
+++ b/tests/basics/fun_error2.py
@@ -0,0 +1,19 @@
+# test errors from bad function calls
+try:
+ enumerate
+except:
+ print("SKIP")
+ import sys
+ sys.exit()
+
+def test_exc(code, exc):
+ try:
+ exec(code)
+ print("no exception")
+ except exc:
+ print("right exception")
+ except:
+ print("wrong exception")
+
+# function with keyword args not given a specific keyword arg
+test_exc("enumerate()", TypeError)