File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 11# Test cases for weakrefs (compile and run)
22
3- # TODO: fixme
4- [case testWeakrefRef-xfail]
3+ [case testWeakrefRef]
54from weakref import ref
65from mypy_extensions import mypyc_attr
76
@@ -10,16 +9,22 @@ class Object:
109 """some random weakreffable object"""
1110 pass
1211
13- def test_weakref_ref() -> None :
12+ def test_weakref_ref():
1413 obj = Object()
1514 r = ref(obj)
1615 assert r() is obj
1716 obj = None
1817 assert r() is None, r()
1918
20- def test_weakref_ref_with_callback() -> None :
19+ def test_weakref_ref_with_callback():
2120 obj = Object()
2221 r = ref(obj, lambda x: x)
2322 assert r() is obj
2423 obj = None
2524 assert r() is None, r()
25+
26+ [file driver.py]
27+ from native import test_weakref_ref, test_weakref_ref_with_callback
28+
29+ test_weakref_ref()
30+ test_weakref_ref_with_callback()
You can’t perform that action at this time.
0 commit comments