summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-rw-r--r--Lib/test/test_asyncio/test_events.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 1e64dd0..03c4149 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -21,6 +21,7 @@ import time
import errno
import unittest
from unittest import mock
+import weakref
from test import support # find_unused_port, IPV6_ENABLED, TEST_HOME_DIR
@@ -1786,6 +1787,11 @@ class HandleTests(unittest.TestCase):
'handle': h
})
+ def test_handle_weakref(self):
+ wd = weakref.WeakValueDictionary()
+ h = asyncio.Handle(lambda: None, (), object())
+ wd['h'] = h # Would fail without __weakref__ slot.
+
class TimerTests(unittest.TestCase):