File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,15 @@ def test_weakref_ref():
1010 obj = asyncio.new_event_loop()
1111 r = ref(obj)
1212 assert r() is obj
13- del obj
13+ obj = None
1414 assert r() is None, r()
1515
1616def test_weakref_ref_with_callback():
1717 # some random weakreffable object
1818 obj = asyncio.new_event_loop()
1919 r = ref(obj, lambda x: x)
2020 assert r() is obj
21- del obj
21+ obj = None
2222 assert r() is None, r()
2323
2424[case testWeakrefProxy]
@@ -31,7 +31,7 @@ def test_weakref_proxy():
3131 obj = asyncio.new_event_loop()
3232 p = proxy(obj)
3333 assert p.is_closed() is False
34- del obj
34+ obj = None
3535 with pytest.raises(ReferenceError):
3636 p.is_closed()
3737
@@ -40,6 +40,6 @@ def test_weakref_proxy_with_callback():
4040 obj = asyncio.new_event_loop()
4141 p = proxy(obj, lambda x: x)
4242 assert p.is_closed() is False
43- del obj
43+ obj = None
4444 with pytest.raises(ReferenceError):
4545 p.is_closed()
You can’t perform that action at this time.
0 commit comments