mirror of
https://github.com/python/cpython.git
synced 2025-10-29 12:44:56 +00:00
and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
16 lines
348 B
Python
16 lines
348 B
Python
from test_support import verify, verbose, TestFailed
|
|
|
|
if verbose:
|
|
print 'Running test on duplicate arguments'
|
|
|
|
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
|