mirror of
https://github.com/python/cpython.git
synced 2026-01-03 22:12:27 +00:00
added test case for fixed duplicate arguments bug in Python/compile.c
This commit is contained in:
parent
1cb3a9ecef
commit
fdee0f0aa7
2 changed files with 17 additions and 0 deletions
1
Lib/test/output/test_compile
Normal file
1
Lib/test/output/test_compile
Normal file
|
|
@ -0,0 +1 @@
|
|||
test_compile
|
||||
16
Lib/test/test_compile.py
Normal file
16
Lib/test/test_compile.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
from test_support import 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue