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

Method test_athrow

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

Source from the content-addressed store, hash-verified

2012 gc_collect()
2013
2014 def test_athrow(self):
2015 async def gen():
2016 yield 1
2017
2018 msg = f"coroutine method 'athrow' of '{gen.__qualname__}' was never awaited"
2019 with self.assertWarnsRegex(RuntimeWarning, msg):
2020 g = gen()
2021 g.athrow(RuntimeError)
2022 gc_collect()
2023
2024 def test_athrow_throws_immediately(self):
2025 async def gen():

Callers

nothing calls this directly

Calls 4

gc_collectFunction · 0.90
assertWarnsRegexMethod · 0.80
genFunction · 0.70
athrowMethod · 0.45

Tested by

no test coverage detected