diff options
author | Guido van Rossum <guido@python.org> | 2014-04-27 10:44:22 -0700 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2014-04-27 10:44:22 -0700 |
commit | 94ba146d11869288ab3def8c7426b3b36701416a (patch) | |
tree | 40e5d7317ea6ff177ffc99e62a13c6034ef8b45c /Lib/test/test_asyncio/test_tasks.py | |
parent | 83c1ddda469e7a99f11afc7d6758b3d80ad9aa3b (diff) | |
download | cpython-94ba146d11869288ab3def8c7426b3b36701416a.tar.gz cpython-94ba146d11869288ab3def8c7426b3b36701416a.zip |
asyncio: Add __weakref__ slots to Handle and CoroWrapper. Upstream issue #166.
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 8 |
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 80571b41913..45a0dc1d210 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: |