Skip to content

Commit 7997d5d

Browse files
committed
restore run-weakref.test
1 parent b44e3be commit 7997d5d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mypyc/test-data/run-weakref.test

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Test cases for weakrefs (compile and run)
22

3-
# TODO: fixme
4-
[case testWeakrefRef-xfail]
3+
[case testWeakrefRef]
54
from weakref import ref
65
from 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()

0 commit comments

Comments
 (0)