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

Method main

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

Source from the content-addressed store, hash-verified

792 raise CustomException
793
794 async def main():
795 task = asyncio.current_task()
796 try:
797 async with taskgroups.TaskGroup() as tg:
798 async with database():
799 tg.create_task(raise_exc())
800 await asyncio.sleep(1)
801 except* CustomException as err:
802 self.assertEqual(task.cancelling(), 0)
803 self.assertEqual(len(err.exceptions), 2)
804
805 else:
806 self.fail('CustomException not raised')
807
808 await asyncio.create_task(main())
809

Callers 1

test_taskgroups.pyFile · 0.45

Calls 5

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

Tested by

no test coverage detected