diff options
author | Yury Selivanov <yselivanov@gmail.com> | 2017-03-12 21:03:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-12 21:03:46 (GMT) |
commit | 216803d8e10615c769571fbfbd1f341557f25a14 (patch) | |
tree | d4f31dc6996a9110835bc6602c3c2c37d14605ce /Lib/test/test_coroutines.py | |
parent | a16894ebf8823f0e09036aacde9288c00e8d9058 (diff) | |
download | cpython-216803d8e10615c769571fbfbd1f341557f25a14.zip cpython-216803d8e10615c769571fbfbd1f341557f25a14.tar.gz cpython-216803d8e10615c769571fbfbd1f341557f25a14.tar.bz2 |
Fix wrapping into StopIteration of return values in generators and coroutines (#644) (#648)
Diffstat (limited to 'Lib/test/test_coroutines.py')
-rw-r--r-- | Lib/test/test_coroutines.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 4a327b5..6d63cdb 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -975,6 +975,21 @@ class CoroutineTest(unittest.TestCase): "coroutine is being awaited already"): waiter(coro).send(None) + def test_await_16(self): + # See https://bugs.python.org/issue29600 for details. + + async def f(): + return ValueError() + + async def g(): + try: + raise KeyError + except: + return await f() + + _, result = run_async(g()) + self.assertIsNone(result.__context__) + def test_with_1(self): class Manager: def __init__(self, name): |