projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bdc43dc
)
added failing exception test for generators
author
Stefan Behnel
<scoder@users.berlios.de>
Sun, 17 Apr 2011 09:45:14 +0000
(11:45 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Sun, 17 Apr 2011 09:45:14 +0000
(11:45 +0200)
tests/run/generators_py.py
patch
|
blob
|
history
diff --git
a/tests/run/generators_py.py
b/tests/run/generators_py.py
index ea16659af2f43b1e424e006ed086ce02eee382df..ac364234be9559dc8f5a978e906db47f40a40321 100644
(file)
--- a/
tests/run/generators_py.py
+++ b/
tests/run/generators_py.py
@@
-155,6
+155,22
@@
def check_throw():
except ValueError:
pass
+def check_yield_in_except():
+ """
+ >>> import sys
+ >>> orig_exc = sys.exc_info()[0]
+ >>> g = check_yield_in_except()
+ >>> next(g)
+ >>> next(g)
+ >>> orig_exc is sys.exc_info()[0] or sys.exc_info()[0]
+ True
+ """
+ try:
+ yield
+ raise ValueError
+ except ValueError:
+ yield
+
def test_swap_assignment():
"""
>>> gen = test_swap_assignment()