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

Method test_async_gen_asyncio_03

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

Source from the content-addressed store, hash-verified

1010 self.loop.run_until_complete(self.to_list(gen()))
1011
1012 def test_async_gen_asyncio_03(self):
1013 loop = self.loop
1014
1015 class Gen:
1016 async def __aiter__(self):
1017 yield 1
1018 await asyncio.sleep(0.01)
1019 yield 2
1020
1021 res = loop.run_until_complete(self.to_list(Gen()))
1022 self.assertEqual(res, [1, 2])
1023
1024 def test_async_gen_asyncio_anext_04(self):
1025 async def foo():

Callers

nothing calls this directly

Calls 4

to_listMethod · 0.95
GenClass · 0.70
run_until_completeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected