MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_2

Method test_2

Lib/test/test_asyncgen.py:653–668  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

651 self.loop.run_until_complete(consume())
652
653 async def test_2():
654 g1 = ait_class()
655 self.assertEqual(await anext(g1), 1)
656 self.assertEqual(await anext(g1), 2)
657 with self.assertRaises(StopAsyncIteration):
658 await anext(g1)
659 with self.assertRaises(StopAsyncIteration):
660 await anext(g1)
661
662 g2 = ait_class()
663 self.assertEqual(await anext(g2, "default"), 1)
664 self.assertEqual(await anext(g2, "default"), 2)
665 self.assertEqual(await anext(g2, "default"), "default")
666 self.assertEqual(await anext(g2, "default"), "default")
667
668 return "completed"
669
670 result = self.loop.run_until_complete(test_2())
671 self.assertEqual(result, "completed")

Callers

nothing calls this directly

Calls 3

anextFunction · 0.85
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected