diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2014-06-25 21:12:58 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2014-06-25 21:12:58 (GMT) |
| commit | 16b3c99141232a6b86c0fc47508d582cdd726005 (patch) | |
| tree | aed2bea8acf50e9a82400cebae742b89b485a682 /Lib/test/test_asyncio/test_tasks.py | |
| parent | 68e915e641b779f2d0378d7e2957da7ae23dc4d8 (diff) | |
| parent | 87f16f892c4a5e96b9e9db3953b1cfc3db51b8f6 (diff) | |
| download | cpython-16b3c99141232a6b86c0fc47508d582cdd726005.zip cpython-16b3c99141232a6b86c0fc47508d582cdd726005.tar.gz cpython-16b3c99141232a6b86c0fc47508d582cdd726005.tar.bz2 | |
(Merge 3.4) Issue #21163, asyncio: Fix some "Task was destroyed but it is
pending!" logs in tests
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
| -rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 7851745..3a23d72 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -1763,16 +1763,14 @@ class CoroutineGatherTests(GatherTestsBase, test_utils.TestCase): gen2 = coro() fut = asyncio.gather(gen1, gen2) self.assertIs(fut._loop, self.one_loop) - gen1.close() - gen2.close() + self.one_loop.run_until_complete(fut) self.set_event_loop(self.other_loop, cleanup=False) gen3 = coro() gen4 = coro() - fut = asyncio.gather(gen3, gen4, loop=self.other_loop) - self.assertIs(fut._loop, self.other_loop) - gen3.close() - gen4.close() + fut2 = asyncio.gather(gen3, gen4, loop=self.other_loop) + self.assertIs(fut2._loop, self.other_loop) + self.other_loop.run_until_complete(fut2) def test_duplicate_coroutines(self): @asyncio.coroutine |
