There was an error while loading. Please reload this page.
1 parent 62ab3f8 commit dd46221Copy full SHA for dd46221
1 file changed
Lib/test/test_asyncio/test_taskgroups.py
@@ -1156,13 +1156,17 @@ async def test_taskgroup_cancel_before_create_task(self):
1156
1157
async def test_taskgroup_cancel_from_child_before_first_suspension(self):
1158
# gh-155418: an eager task can cancel the group before joining _tasks
1159
+ done = []
1160
+
1161
async def child(tg):
1162
tg.cancel()
1163
await asyncio.sleep(10)
1164
+ done.append(True)
1165
1166
async with asyncio.TaskGroup() as tg:
1167
task = tg.create_task(child(tg))
1168
self.assertTrue(task.cancelled())
1169
+ self.assertEqual(done, [])
1170
1171
async def test_taskgroup_cancel_before_exception(self):
1172
async def raise_exc(parent_tg: asyncio.TaskGroup):
0 commit comments