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

Method test_async_gen_asyncio_02

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

Source from the content-addressed store, hash-verified

999 self.assertEqual(res, [1, 2])
1000
1001 def test_async_gen_asyncio_02(self):
1002 async def gen():
1003 yield 1
1004 await asyncio.sleep(0.01)
1005 yield 2
1006 1 / 0
1007 yield 3
1008
1009 with self.assertRaises(ZeroDivisionError):
1010 self.loop.run_until_complete(self.to_list(gen()))
1011
1012 def test_async_gen_asyncio_03(self):
1013 loop = self.loop

Callers

nothing calls this directly

Calls 4

to_listMethod · 0.95
genFunction · 0.70
assertRaisesMethod · 0.45
run_until_completeMethod · 0.45

Tested by

no test coverage detected