2001-01-17 17:51:36 -04:00
|
|
|
from test_support import verbose, TestFailed
|
2000-07-25 19:15:45 -03:00
|
|
|
|
|
|
|
if verbose:
|
2001-01-18 23:25:56 -04:00
|
|
|
print 'Running tests on argument handling'
|
2000-07-25 19:15:45 -03:00
|
|
|
|
|
|
|
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
|
2001-01-18 23:25:56 -04:00
|
|
|
|
|
|
|
try:
|
|
|
|
exec('def f(a): global a; a = 1')
|
|
|
|
raise TestFailed, "variable is global and local"
|
|
|
|
except SyntaxError:
|
|
|
|
pass
|