[pypy-svn] r58376 - pypy/branch/2.5-features/pypy/interpreter/pyparser/test
fijal at codespeak.net
fijal at codespeak.net
Tue Sep 23 13:32:47 CEST 2008
Author: fijal
Date: Tue Sep 23 13:32:45 2008
New Revision: 58376
Modified:
pypy/branch/2.5-features/pypy/interpreter/pyparser/test/expressions.py
pypy/branch/2.5-features/pypy/interpreter/pyparser/test/test_astbuilder.py
Log:
A test for yield expression. Just in order to make sure this is tested
Modified: pypy/branch/2.5-features/pypy/interpreter/pyparser/test/expressions.py
==============================================================================
--- pypy/branch/2.5-features/pypy/interpreter/pyparser/test/expressions.py (original)
+++ pypy/branch/2.5-features/pypy/interpreter/pyparser/test/expressions.py Tue Sep 23 13:32:45 2008
@@ -484,6 +484,7 @@
CHANGES_25_INPUTS = [
["class A(): pass"],
+ ["def f(): x = yield 3"]
]
EXEC_INPUTS = [
Modified: pypy/branch/2.5-features/pypy/interpreter/pyparser/test/test_astbuilder.py
==============================================================================
--- pypy/branch/2.5-features/pypy/interpreter/pyparser/test/test_astbuilder.py (original)
+++ pypy/branch/2.5-features/pypy/interpreter/pyparser/test/test_astbuilder.py Tue Sep 23 13:32:45 2008
@@ -174,6 +174,7 @@
# yield changed in 2.5, so we can not trust the stablecompiler
"def f(n):\n for i in range(n):\n yield n\n": "Module(None, Stmt([Function(None, 'f', [AssName('n', 0)], [], 0, None, Stmt([For(AssName('i', 0), CallFunc(Name('range'), [Name('n')], None, None), Stmt([Discard(Yield(Name('n')))]), None)]))]))",
+ "def f(): x = yield 3": "Module(None, Stmt([Function(None, 'f', [], [], 0, None, Stmt([Assign([AssName('x', 0)], Yield(Const(3)))]))]))",
# stablecompiler produces a Pass statement which does not seem very consistent
# (a module should only have a Stmt child)
More information about the Pypy-commit
mailing list