8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6af08b commit 54f4895Copy full SHA for 54f4895
Lib/test/test_asyncio/test_waitfor.py
@@ -289,6 +289,19 @@ async def test_cancel_blocking_wait_for(self):
289
async def test_cancel_wait_for(self):
290
await self._test_cancel_wait_for(60.0)
291
292
+ async def test_wait_for_cancellation_propagates(self):
293
+ # https://github.com/python/cpython/issues/86296
294
+ inner = asyncio.get_running_loop().create_future()
295
+ outer = asyncio.wait_for(inner, 0.1)
296
+ outer_future = asyncio.create_task(outer)
297
+ await asyncio.sleep(0)
298
+ inner.set_result(None) # inner is done
299
+ outer_future.cancel() # AND outer got cancelled
300
+
301
+ # this fails starting with Python 3.8
302
+ with self.assertRaises(asyncio.CancelledError):
303
+ await outer_future
304
305
306
if __name__ == '__main__':
307
unittest.main()
0 commit comments