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 9d7d34a commit 7bb4cd5Copy full SHA for 7bb4cd5
mypyc/test-data/run-weakref.test
@@ -4,15 +4,18 @@
4
import pytest # type: ignore [import-not-found]
5
from weakref import ref
6
7
+class MyClass:
8
+ pass
9
+
10
def test_weakref_ref():
- obj = object()
11
+ obj = MyClass()
12
r = ref(obj)
13
assert r() is obj
14
del obj
15
assert r() is None
16
17
def test_weakref_ref_with_callback():
18
19
r = ref(obj, lambda x: x)
20
21
@@ -22,7 +25,7 @@ def test_weakref_ref_with_callback():
22
25
23
26
from weakref import proxy
24
27
-class MyClass():
28
29
def do_thing(self):
30
return True
31
0 commit comments