From: Stefan Behnel Date: Fri, 18 Jan 2013 09:05:50 +0000 (+0100) Subject: extended test case X-Git-Tag: 0.19b1~299 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=848176a5cf4290c4e5e77629a883d551cefbff01;p=platform%2Fupstream%2Fpython-cython.git extended test case --- diff --git a/tests/run/yield_from_pep380.pyx b/tests/run/yield_from_pep380.pyx index 2426d26..4c76b25 100644 --- a/tests/run/yield_from_pep380.pyx +++ b/tests/run/yield_from_pep380.pyx @@ -259,6 +259,7 @@ def test_handing_exception_while_delegating_close(): Yielded g2 spam Finishing g2 Finishing g1 + nybbles have exploded with delight """ trace = [] def g1(): @@ -283,8 +284,11 @@ def test_handing_exception_while_delegating_close(): x = next(g) trace.append("Yielded %s" % (x,)) g.close() - except ValueError: - pass + except ValueError as e: + trace.append(e.args[0]) + # FIXME: __context__ is currently not set + #if sys.version_info[0] >= 3: + # assert isinstance(e.__context__, GeneratorExit), 'exception context is %r' % e.__context__ else: trace.append("subgenerator failed to raise ValueError") return trace