diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-03-17 00:19:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-17 00:19:51 (GMT) |
commit | 36f62c55759c4246f969f60f7470ba756f77b268 (patch) | |
tree | bccd9849f4826df7bf8f55f53b937bba0138b949 /Lib/test/test_asyncio/test_tasks.py | |
parent | 4186dd662cf22613b21af948163978af4243a8d6 (diff) | |
download | cpython-36f62c55759c4246f969f60f7470ba756f77b268.zip cpython-36f62c55759c4246f969f60f7470ba756f77b268.tar.gz cpython-36f62c55759c4246f969f60f7470ba756f77b268.tar.bz2 |
bpo-47038: Rewrite missed asyncio.wait_for test to use IsolatedAnsyncioTestCase (GH-31946) (#31948)
(cherry picked from commit 3dd9bfac04d3dcdbfd3f8011a6c9d4b9ac8c116a)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 7f3cf8b..0007b44 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -2292,32 +2292,6 @@ class BaseTaskTests: 'test_task_source_traceback')) self.loop.run_until_complete(task) - def _test_cancel_wait_for(self, timeout): - loop = asyncio.new_event_loop() - self.addCleanup(loop.close) - - async def blocking_coroutine(): - fut = self.new_future(loop) - # Block: fut result is never set - await fut - - task = loop.create_task(blocking_coroutine()) - - wait = loop.create_task(asyncio.wait_for(task, timeout)) - loop.call_soon(wait.cancel) - - self.assertRaises(asyncio.CancelledError, - loop.run_until_complete, wait) - - # Python issue #23219: cancelling the wait must also cancel the task - self.assertTrue(task.cancelled()) - - def test_cancel_blocking_wait_for(self): - self._test_cancel_wait_for(None) - - def test_cancel_wait_for(self): - self._test_cancel_wait_for(60.0) - def test_cancel_gather_1(self): """Ensure that a gathering future refuses to be cancelled once all children are done""" |