Author: Armin Rigo <[email protected]>
Branch: gc-del
Changeset: r63614:7e349f0e4d68
Date: 2013-04-25 18:50 +0200
http://bitbucket.org/pypy/pypy/changeset/7e349f0e4d68/
Log: Test that "del A.__del__" works.
diff --git a/pypy/objspace/std/test/test_typeobject.py
b/pypy/objspace/std/test/test_typeobject.py
--- a/pypy/objspace/std/test/test_typeobject.py
+++ b/pypy/objspace/std/test/test_typeobject.py
@@ -1074,6 +1074,20 @@
import gc; gc.collect()
assert seen
+ def test_remove_del(self):
+ seen = []
+ class A(object):
+ def __del__(self):
+ seen.append(1)
+ a = A()
+ del A.__del__
+ a = 42
+ for i in range(5):
+ if seen:
+ break
+ import gc; gc.collect()
+ assert not seen
+
class AppTestWithMethodCacheCounter:
spaceconfig = {"objspace.std.withmethodcachecounter": True}
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit