summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/fun_error2.py
blob: c4d2c0b64d6715e1049ea65d2bcfc708193dfee5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)