Commits

Armin Rigo committed 6fed217

A failing test.

Comments (0)

Files changed (1)

pypy/objspace/std/test/test_typeobject.py

             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}