diff options
author | Yury Selivanov <yury@magic.io> | 2016-10-20 19:54:20 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2016-10-20 19:54:20 (GMT) |
commit | a4b884f9009e9797e8bb7f8c9e797b4f033dd37e (patch) | |
tree | 2fde8b0eb3839d17740aa05f0d8cc5e86c9aec83 /Lib | |
parent | 82919ec44ff49aa2343ed433705efdc76b24b5c5 (diff) | |
download | cpython-a4b884f9009e9797e8bb7f8c9e797b4f033dd37e.zip cpython-a4b884f9009e9797e8bb7f8c9e797b4f033dd37e.tar.gz cpython-a4b884f9009e9797e8bb7f8c9e797b4f033dd37e.tar.bz2 |
Issue #28492: Fix how StopIteration is raised in _asyncio.Future
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_asyncio/test_futures.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_futures.py b/Lib/test/test_asyncio/test_futures.py index d20eb68..6916b51 100644 --- a/Lib/test/test_asyncio/test_futures.py +++ b/Lib/test/test_asyncio/test_futures.py @@ -464,6 +464,19 @@ class FutureTests(test_utils.TestCase): futures._set_result_unless_cancelled(fut, 2) self.assertTrue(fut.cancelled()) + def test_future_stop_iteration_args(self): + fut = asyncio.Future(loop=self.loop) + fut.set_result((1, 2)) + fi = fut.__iter__() + result = None + try: + fi.send(None) + except StopIteration as ex: + result = ex.args[0] + else: + self.fail('StopIteration was expected') + self.assertEqual(result, (1, 2)) + class FutureDoneCallbackTests(test_utils.TestCase): |