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

Method test_eager_start_false

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

Source from the content-addressed store, hash-verified

2740 await t
2741
2742 def test_eager_start_false(self):
2743 name = None
2744
2745 async def asyncfn():
2746 nonlocal name
2747 name = self.current_task().get_name()
2748
2749 async def main():
2750 t = self.new_task(coro=asyncfn(), loop=asyncio.get_running_loop(), eager_start=False, name="example")
2751 self.assertFalse(t.done())
2752 self.assertIsNone(name)
2753 await t
2754 self.assertEqual(name, "example")
2755
2756 asyncio.run(main(), loop_factory=asyncio.EventLoop)
2757
2758 def test_get_coro(self):
2759 loop = asyncio.new_event_loop()

Callers

nothing calls this directly

Calls 2

mainFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected