Commit 41099685 authored by Stefan Behnel's avatar Stefan Behnel

moved yield-in-lambda test to new test file to disable it in Py2.6

parent 1a40a607
...@@ -176,6 +176,7 @@ VER_DEP_MODULES = { ...@@ -176,6 +176,7 @@ VER_DEP_MODULES = {
'run.purecdef', 'run.purecdef',
]), ]),
(2,7) : (operator.lt, lambda x: x in ['run.withstat_py', # multi context with statement (2,7) : (operator.lt, lambda x: x in ['run.withstat_py', # multi context with statement
'run.yield_inside_lambda.py',
]), ]),
# The next line should start (3,); but this is a dictionary, so # The next line should start (3,); but this is a dictionary, so
# we can only have one (3,) key. Since 2.7 is supposed to be the # we can only have one (3,) key. Since 2.7 is supposed to be the
......
...@@ -305,19 +305,6 @@ def test_nested_yield(): ...@@ -305,19 +305,6 @@ def test_nested_yield():
""" """
yield (yield (yield 1)) yield (yield (yield 1))
def test_inside_lambda():
"""
>>> obj = test_inside_lambda()()
>>> next(obj)
1
>>> next(obj)
2
>>> next(obj)
Traceback (most recent call last):
StopIteration
"""
return lambda:((yield 1), (yield 2))
def test_nested_gen(n): def test_nested_gen(n):
""" """
>>> [list(a) for a in test_nested_gen(5)] >>> [list(a) for a in test_nested_gen(5)]
......
# mode: run
# tag: generators, lambda
try:
from builtins import next # Py3k
except ImportError:
def next(it):
return it.next()
def test_inside_lambda():
"""
>>> obj = test_inside_lambda()()
>>> next(obj)
1
>>> next(obj)
2
>>> next(obj)
Traceback (most recent call last):
StopIteration
"""
return lambda:((yield 1), (yield 2))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment