summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index 80571b4..45a0dc1 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -4,6 +4,7 @@ import gc
import os.path
import types
import unittest
+import weakref
from test.script_helper import assert_python_ok
import asyncio
@@ -1475,6 +1476,13 @@ class TaskTests(unittest.TestCase):
self.assertEqual(call((1, 2)), (1, 2))
self.assertEqual(call('spam'), 'spam')
+ def test_corowrapper_weakref(self):
+ wd = weakref.WeakValueDictionary()
+ def foo(): yield from []
+ cw = asyncio.tasks.CoroWrapper(foo(), foo)
+ wd['cw'] = cw # Would fail without __weakref__ slot.
+ cw.gen = None # Suppress warning from __del__.
+
class GatherTestsBase: