There was an error while loading. Please reload this page.
1 parent af8a20c commit 0dcc98dCopy full SHA for 0dcc98d
1 file changed
Lib/test/test_asyncio/test_tasks.py
@@ -1268,6 +1268,19 @@ async def coro():
1268
1269
self.loop.run_until_complete(self.new_task(self.loop, coro()))
1270
1271
+ def test_gather_does_not_add_callback_to_outer(self):
1272
+ # gh-158239: gather() must not add an internal done callback to
1273
+ # the outer future just to maintain the await graph.
1274
+ async def child():
1275
+ await asyncio.sleep(0)
1276
+
1277
+ async def coro():
1278
+ outer = asyncio.gather(child(), child())
1279
+ self.assertFalse(outer._callbacks)
1280
+ await outer
1281
1282
+ self.loop.run_until_complete(self.new_task(self.loop, coro()))
1283
1284
def test_wait_really_done(self):
1285
# there is possibility that some tasks in the pending list
1286
# became done but their callbacks haven't all been called yet
0 commit comments