summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncgen.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncgen.py')
-rw-r--r--Lib/test/test_asyncgen.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py
index a496301..7fa0a85 100644
--- a/Lib/test/test_asyncgen.py
+++ b/Lib/test/test_asyncgen.py
@@ -1701,6 +1701,14 @@ class TestUnawaitedWarnings(unittest.TestCase):
async def gen():
yield 1
+ # gh-113753: asend objects allocated from a free-list should warn.
+ # Ensure there is a finalized 'asend' object ready to be reused.
+ try:
+ g = gen()
+ g.asend(None).send(None)
+ except StopIteration:
+ pass
+
msg = f"coroutine method 'asend' of '{gen.__qualname__}' was never awaited"
with self.assertWarnsRegex(RuntimeWarning, msg):
g = gen()