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

Method test_aclose_throw

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

Source from the content-addressed store, hash-verified

2050 gc_collect()
2051
2052 def test_aclose_throw(self):
2053 async def gen():
2054 return
2055 yield
2056
2057 class MyException(Exception):
2058 pass
2059
2060 g = gen()
2061 with self.assertRaises(MyException):
2062 g.aclose().throw(MyException)
2063
2064 del g
2065 gc_collect() # does not warn unawaited
2066
2067 def test_asend_send_already_running(self):
2068 @types.coroutine

Callers

nothing calls this directly

Calls 5

gc_collectFunction · 0.90
genFunction · 0.70
assertRaisesMethod · 0.45
throwMethod · 0.45
acloseMethod · 0.45

Tested by

no test coverage detected