summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compile.py
blob: dff775803868d96ecf1fb7b3879087d2298f1ebf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from test_support import verbose, TestFailed

if verbose:
    print 'Running tests on argument handling'

try:
    exec('def f(a, a): pass')
    raise TestFailed, "duplicate arguments"
except SyntaxError:
    pass

try:
    exec('def f(a = 0, a = 1): pass')
    raise TestFailed, "duplicate keyword arguments"
except SyntaxError:
    pass

try:
    exec('def f(a): global a; a = 1')
    raise TestFailed, "variable is global and local"
except SyntaxError:
    pass