MCPcopy Index your code
hub / github.com/python/cpython / inner

Method inner

Lib/test/test_asyncio/test_taskgroups.py:906–916  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

904 raise RuntimeError()
905
906 async def inner():
907 try:
908 async with taskgroups.TaskGroup() as tg:
909 tg.create_task(raise_error())
910 await asyncio.sleep(1)
911 self.fail("Sleep in group should have been cancelled")
912 except* RuntimeError:
913 self.assertEqual(asyncio.current_task().cancelling(), 1)
914 self.assertEqual(asyncio.current_task().cancelling(), 1)
915 await asyncio.sleep(1)
916 self.fail("Sleep after group should have been cancelled")
917
918 async def outer():
919 t = asyncio.create_task(inner())

Callers

nothing calls this directly

Calls 6

raise_errorFunction · 0.85
cancellingMethod · 0.80
create_taskMethod · 0.45
sleepMethod · 0.45
failMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected