home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Programming / Python2 / Lib / Python2.0 / test / test_compile.py < prev    next >
Encoding:
Python Source  |  2000-10-25  |  340 b   |  17 lines

  1. from test_support import verbose, TestFailed
  2.  
  3. if verbose:
  4.     print 'Running test on duplicate arguments'
  5.  
  6. try:
  7.     exec('def f(a, a): pass')
  8.     raise TestFailed, "duplicate arguments"
  9. except SyntaxError:
  10.     pass
  11.  
  12. try:
  13.     exec('def f(a = 0, a = 1): pass')
  14.     raise TestFailed, "duplicate keyword arguments"
  15. except SyntaxError:
  16.     pass
  17.