Skip to content

Commit 8f4049a

Browse files
committed
review changes
1 parent 131b0b8 commit 8f4049a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/test/test_asyncio/test_taskgroups.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,9 +1170,10 @@ async def body():
11701170

11711171
task = asyncio.create_task(body())
11721172
await asyncio.sleep(0.01)
1173-
task.cancel()
1174-
with self.assertRaises(asyncio.CancelledError):
1173+
task.cancel('message')
1174+
with self.assertRaises(asyncio.CancelledError) as cm:
11751175
await task
1176+
self.assertEqual('message', cm.exception.args[0])
11761177

11771178
async def test_taskgroup_cancel_before_exception(self):
11781179
async def raise_exc(parent_tg: asyncio.TaskGroup):

0 commit comments

Comments
 (0)