equal
deleted
inserted
replaced
|
1 # |
|
2 # This file is for everybody to add tests for bugs that aren't |
|
3 # fixed yet. Please add a test case and appropriate bug description. |
|
4 # |
|
5 # When you fix one of the bugs, please move the test to the correct |
|
6 # test_ module. |
|
7 # |
|
8 |
|
9 import unittest |
|
10 from test import test_support |
|
11 |
|
12 class TestBug1385040(unittest.TestCase): |
|
13 def testSyntaxError(self): |
|
14 import compiler |
|
15 |
|
16 # The following snippet gives a SyntaxError in the interpreter |
|
17 # |
|
18 # If you compile and exec it, the call foo(7) returns (7, 1) |
|
19 self.assertRaises(SyntaxError, compiler.compile, |
|
20 "def foo(a=1, b): return a, b\n\n", "<string>", "exec") |
|
21 |
|
22 |
|
23 def test_main(): |
|
24 test_support.run_unittest(TestBug1385040) |
|
25 |
|
26 if __name__ == "__main__": |
|
27 test_main() |