summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-03-02 13:03:51 (GMT)
committerGitHub <noreply@github.com>2020-03-02 13:03:50 (GMT)
commit43932dc1eaf36d75b2ee0420d8be747001315c26 (patch)
tree2a830592594f021120056cb5daf0667f5a1bb42e /Lib/test
parentf28b0c74e54a133cb0287b4297af67d0d7c14d6e (diff)
downloadcpython-43932dc1eaf36d75b2ee0420d8be747001315c26.zip
cpython-43932dc1eaf36d75b2ee0420d8be747001315c26.tar.gz
cpython-43932dc1eaf36d75b2ee0420d8be747001315c26.tar.bz2
bpo-39764: Make Task.get_stack accept ag_frame (GH-18669)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> (cherry picked from commit 4482337decdbd0c6e2150346a68b3616bda664aa) Co-authored-by: Lidi Zheng <scallopsky@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_asyncgen.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py
index fb6321d..62bf877 100644
--- a/Lib/test/test_asyncgen.py
+++ b/Lib/test/test_asyncgen.py
@@ -1191,5 +1191,20 @@ class AsyncGenAsyncioTest(unittest.TestCase):
self.loop.run_until_complete(run())
+ def test_async_gen_aclose_compatible_with_get_stack(self):
+ async def async_generator():
+ yield object()
+
+ async def run():
+ ag = async_generator()
+ asyncio.create_task(ag.aclose())
+ tasks = asyncio.all_tasks()
+ for task in tasks:
+ # No AttributeError raised
+ task.get_stack()
+
+ self.loop.run_until_complete(run())
+
+
if __name__ == "__main__":
unittest.main()