(self)
| 2010 | class TestUnawaitedWarnings(unittest.TestCase): |
| 2011 | @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: RuntimeWarning not triggered |
| 2012 | def test_asend(self): |
| 2013 | async def gen(): |
| 2014 | yield 1 |
| 2015 | |
| 2016 | # gh-113753: asend objects allocated from a free-list should warn. |
| 2017 | # Ensure there is a finalized 'asend' object ready to be reused. |
| 2018 | try: |
| 2019 | g = gen() |
| 2020 | g.asend(None).send(None) |
| 2021 | except StopIteration: |
| 2022 | pass |
| 2023 | |
| 2024 | msg = f"coroutine method 'asend' of '{gen.__qualname__}' was never awaited" |
| 2025 | with self.assertWarnsRegex(RuntimeWarning, msg): |
| 2026 | g = gen() |
| 2027 | g.asend(None) |
| 2028 | gc_collect() |
| 2029 | |
| 2030 | @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: RuntimeWarning not triggered |
| 2031 | def test_athrow(self): |
nothing calls this directly
no test coverage detected