diff options
author | Phillip J. Eby <pje@telecommunity.com> | 2005-08-02 00:46:46 (GMT) |
---|---|---|
committer | Phillip J. Eby <pje@telecommunity.com> | 2005-08-02 00:46:46 (GMT) |
commit | 0d6615fd29063bdaccb13e1fbae542fb666d8728 (patch) | |
tree | 0f18d41e2cb8831c9d244ab6586f9f8377592c67 /Lib/test/test_parser.py | |
parent | d794666048510deca0d4987a4c74d0fca85be411 (diff) | |
download | cpython-0d6615fd29063bdaccb13e1fbae542fb666d8728.zip cpython-0d6615fd29063bdaccb13e1fbae542fb666d8728.tar.gz cpython-0d6615fd29063bdaccb13e1fbae542fb666d8728.tar.bz2 |
PEP 342 implementation. Per Guido's comments, the generator throw()
method still needs to support string exceptions, and allow None for the
third argument. Documentation updates are needed, too.
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 205c406..d1ace67 100644 --- a/Lib/test/test_parser.py +++ b/Lib/test/test_parser.py @@ -29,11 +29,22 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase): def test_yield_statement(self): self.check_suite("def f(): yield 1") + self.check_suite("def f(): yield") + self.check_suite("def f(): x += yield") + self.check_suite("def f(): x = yield 1") + self.check_suite("def f(): x = y = yield 1") + self.check_suite("def f(): x = yield") + self.check_suite("def f(): x = y = yield") + self.check_suite("def f(): 1 + (yield)*2") + 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():\n" " for x in range(30):\n" " yield x\n") + self.check_suite("def f():\n" + " if (yield):\n" + " yield x\n") def test_expressions(self): self.check_expr("foo(1)") |