Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3653a3 commit 7836a27Copy full SHA for 7836a27
1 file changed
Lib/test/lock_tests.py
@@ -7,6 +7,7 @@
7
from _thread import start_new_thread, TIMEOUT_MAX
8
import threading
9
import unittest
10
+import weakref
11
12
from test import support
13
@@ -198,6 +199,17 @@ def f():
198
199
self.assertFalse(results[0])
200
self.assertTimeout(results[1], 0.5)
201
202
+ def test_weakref_exists(self):
203
+ lock = self.locktype()
204
+ ref = weakref.ref(lock)
205
+ self.assertIsNotNone(ref())
206
+
207
+ def test_weakref_deleted(self):
208
209
210
+ del lock
211
+ self.assertIsNone(ref())
212
213
214
class LockTests(BaseLockTests):
215
"""
0 commit comments