Skip to content

Commit c9705cf

Browse files
committed
tests/basics/fun_error: Split out skippable test.
1 parent 854bb32 commit c9705cf

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

tests/basics/fun_error.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ def test_exc(code, exc):
2727
# function with keyword args given extra keyword args
2828
test_exc("[].sort(noexist=1)", TypeError)
2929

30-
# function with keyword args not given a specific keyword arg
31-
test_exc("enumerate()", TypeError)
32-
3330
# kw given for positional, but a different positional is missing
3431
test_exc("def f(x, y): pass\nf(x=1)", TypeError)

tests/basics/fun_error2.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# test errors from bad function calls
2+
try:
3+
enumerate
4+
except:
5+
print("SKIP")
6+
import sys
7+
sys.exit()
8+
9+
def test_exc(code, exc):
10+
try:
11+
exec(code)
12+
print("no exception")
13+
except exc:
14+
print("right exception")
15+
except:
16+
print("wrong exception")
17+
18+
# function with keyword args not given a specific keyword arg
19+
test_exc("enumerate()", TypeError)

0 commit comments

Comments
 (0)