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

Method test3

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

Source from the content-addressed store, hash-verified

889 g.throw(MyError())
890
891 def test3(anext):
892 agen = agenfn()
893 with contextlib.closing(anext(agen, "default").__await__()) as g:
894 self.assertEqual(g.send(None), 1)
895 g.close()
896 with self.assertRaisesRegex(RuntimeError, 'cannot reuse'):
897 self.assertEqual(g.send(None), 1)
898
899 def test4(anext):
900 @types.coroutine

Callers

nothing calls this directly

Calls 7

anextFunction · 0.85
closingMethod · 0.80
assertRaisesRegexMethod · 0.80
__await__Method · 0.45
assertEqualMethod · 0.45
sendMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected