MCPcopy Index your code
hub / github.com/python/cpython / test_aclose_throw

Method test_aclose_throw

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

Source from the content-addressed store, hash-verified

2041 gc_collect()
2042
2043 def test_aclose_throw(self):
2044 async def gen():
2045 return
2046 yield
2047
2048 class MyException(Exception):
2049 pass
2050
2051 g = gen()
2052 with self.assertRaises(MyException):
2053 g.aclose().throw(MyException)
2054
2055 del g
2056 gc_collect() # does not warn unawaited
2057
2058 def test_asend_send_already_running(self):
2059 @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