Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
41099685
Commit
41099685
authored
May 29, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved yield-in-lambda test to new test file to disable it in Py2.6
parent
1a40a607
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
+22
-13
runtests.py
runtests.py
+1
-0
tests/run/generators_py.py
tests/run/generators_py.py
+0
-13
tests/run/yield_inside_lambda.py
tests/run/yield_inside_lambda.py
+21
-0
No files found.
runtests.py
View file @
41099685
...
@@ -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
...
...
tests/run/generators_py.py
View file @
41099685
...
@@ -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)]
...
...
tests/run/yield_inside_lambda.py
0 → 100644
View file @
41099685
# 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
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment