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

Method test1

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

Source from the content-addressed store, hash-verified

868 yield
869
870 def test1(anext):
871 agen = agenfn()
872 with contextlib.closing(anext(agen, "default").__await__()) as g:
873 self.assertEqual(g.send(None), 1)
874 self.assertEqual(g.throw(MyError()), 2)
875 try:
876 g.send(None)
877 except StopIteration as e:
878 err = e
879 else:
880 self.fail('StopIteration was not raised')
881 self.assertEqual(err.value, "default")
882
883 def test2(anext):
884 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
failMethod · 0.45

Tested by

no test coverage detected