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

Method test_task_basics

Lib/test/test_asyncio/test_tasks.py:441–455  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

439 self.loop.run_until_complete(task)
440
441 def test_task_basics(self):
442
443 async def outer():
444 a = await inner1()
445 b = await inner2()
446 return a+b
447
448 async def inner1():
449 return 42
450
451 async def inner2():
452 return 1000
453
454 t = outer()
455 self.assertEqual(self.loop.run_until_complete(t), 1042)
456
457 def test_exception_chaining_after_await(self):
458 # Test that when awaiting on a task when an exception is already

Callers

nothing calls this directly

Calls 3

outerFunction · 0.50
assertEqualMethod · 0.45
run_until_completeMethod · 0.45

Tested by

no test coverage detected