Skip to content

Commit 9d7d34a

Browse files
Update run-weakref.test
1 parent 62acc03 commit 9d7d34a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

mypyc/test-data/run-weakref.test

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,22 @@ def test_weakref_ref_with_callback():
2222
import pytest # type: ignore [import-not-found]
2323
from weakref import proxy
2424

25+
class MyClass():
26+
def do_thing(self):
27+
return True
28+
2529
def test_weakref_proxy():
26-
class MyClass():
27-
def test(self):
28-
return True
2930
obj = MyClass()
3031
p = proxy(obj)
31-
assert p.test() is True
32+
assert p.do_thing() is True
3233
del obj
3334
with pytest.raises(ReferenceError):
34-
p.test()
35+
p.do_thing()
3536

3637
def test_weakref_proxy_with_callback():
37-
class MyClass():
38-
def test(self):
39-
return True
4038
obj = MyClass()
4139
p = proxy(obj, lambda x: x)
42-
assert p.test() is True
40+
assert p.do_thing() is True
4341
del obj
4442
with pytest.raises(ReferenceError):
45-
p.test()
43+
p.do_thing()

0 commit comments

Comments
 (0)