summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/fun_error2.py
blob: 2a00396e65d84e7d1dbe7f249d40c2155d75ee1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# test errors from bad function calls
try:
    enumerate
except:
    print("SKIP")
    raise SystemExit

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)