diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2012-01-13 11:43:40 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2012-01-13 11:43:40 (GMT) |
commit | 1f7ce62bd61488d5d721896a36a1b43befab88b5 (patch) | |
tree | e7c92d4429ce431c78d0b7816c93862629590223 /Lib/test/test_parser.py | |
parent | e51757f6de9db71b7ee0a6cbf7dde62e9f146804 (diff) | |
download | cpython-1f7ce62bd61488d5d721896a36a1b43befab88b5.zip cpython-1f7ce62bd61488d5d721896a36a1b43befab88b5.tar.gz cpython-1f7ce62bd61488d5d721896a36a1b43befab88b5.tar.bz2 |
Implement PEP 380 - 'yield from' (closes #11682)
Diffstat (limited to 'Lib/test/test_parser.py')
-rw-r--r-- | Lib/test/test_parser.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py index 2b50fca..b6f81fb 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") @@ -621,7 +625,6 @@ class OtherParserCase(unittest.TestCase): with self.assertRaises(TypeError): parser.expr("a", "b") - def test_main(): support.run_unittest( RoundtripLegalSyntaxTestCase, |