diff options
Diffstat (limited to 'Lib/test/test_parser.py')
-rw-r--r-- | Lib/test/test_parser.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py index cae09df..e199728 100644 --- a/Lib/test/test_parser.py +++ b/Lib/test/test_parser.py @@ -50,6 +50,10 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase): self.check_suite("def f(): (yield 1)*2") self.check_suite("def f(): return; yield 1") self.check_suite("def f(): yield 1; return") + self.check_suite("def f(): yield from 1") + self.check_suite("def f(): x = yield from 1") + self.check_suite("def f(): f((yield from 1))") + self.check_suite("def f(): yield 1; return 1") self.check_suite("def f():\n" " for x in range(30):\n" " yield x\n") @@ -678,6 +682,12 @@ class STObjectTestCase(unittest.TestCase): # XXX tests for pickling and unpickling of ST objects should go here +class OtherParserCase(unittest.TestCase): + + def test_two_args_to_expr(self): + # See bug #12264 + with self.assertRaises(TypeError): + parser.expr("a", "b") def test_main(): support.run_unittest( @@ -686,6 +696,7 @@ def test_main(): CompileTestCase, ParserStackLimitTestCase, STObjectTestCase, + OtherParserCase, ) |