Author: Armin Rigo <ar...@tunes.org>
Branch: gc-del
Changeset: r63892:6fed217ef39c
Date: 2013-05-06 20:12 +0200
http://bitbucket.org/pypy/pypy/changeset/6fed217ef39c/

Log:    A failing test.

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
@@ -1047,6 +1047,22 @@
             import gc; gc.collect()
         assert not seen
 
+    def test_change_type_to_add_del(self):
+        seen = []
+        class A(object):
+            def __del__(self):
+                seen.append(1)
+        class B(object):
+            pass
+        b = B()
+        b.__class__ = A
+        b = 42
+        for i in range(5):
+            if seen:
+                break
+            import gc; gc.collect()
+        assert seen
+
 
 class AppTestWithMethodCacheCounter:
     spaceconfig = {"objspace.std.withmethodcachecounter": True}
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to