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

Method test_async_gen_asyncio_01

Lib/test/test_asyncgen.py:989–999  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

987 return res
988
989 def test_async_gen_asyncio_01(self):
990 async def gen():
991 yield 1
992 await asyncio.sleep(0.01)
993 yield 2
994 await asyncio.sleep(0.01)
995 return
996 yield 3
997
998 res = self.loop.run_until_complete(self.to_list(gen()))
999 self.assertEqual(res, [1, 2])
1000
1001 def test_async_gen_asyncio_02(self):
1002 async def gen():

Callers

nothing calls this directly

Calls 4

to_listMethod · 0.95
genFunction · 0.70
run_until_completeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected