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

Method test2

Lib/test/test_asyncgen.py:883–889  ·  view source on GitHub ↗
(anext)

Source from the content-addressed store, hash-verified

881 self.assertEqual(err.value, "default")
882
883 def test2(anext):
884 agen = agenfn()
885 with contextlib.closing(anext(agen, "default").__await__()) as g:
886 self.assertEqual(g.send(None), 1)
887 self.assertEqual(g.throw(MyError()), 2)
888 with self.assertRaises(MyError):
889 g.throw(MyError())
890
891 def test3(anext):
892 agen = agenfn()

Callers

nothing calls this directly

Calls 8

anextFunction · 0.85
closingMethod · 0.80
MyErrorClass · 0.70
__await__Method · 0.45
assertEqualMethod · 0.45
sendMethod · 0.45
throwMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected