File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -22,24 +22,22 @@ def test_weakref_ref_with_callback():
2222import pytest # type: ignore [import-not-found]
2323from weakref import proxy
2424
25+ class MyClass():
26+ def do_thing(self):
27+ return True
28+
2529def 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
3637def 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 ()
You can’t perform that action at this time.
0 commit comments