Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r84321:4e12001044f0
Date: 2016-05-09 09:30 +0200
http://bitbucket.org/pypy/pypy/changeset/4e12001044f0/

Log:    Fix the test. Now it fails only for subclasses, which is what I
        originally expected

diff --git a/pypy/module/cpyext/test/test_typeobject.py 
b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -924,7 +924,6 @@
 
     @pytest.mark.xfail
     def test_call_tp_dealloc_when_created_from_python(self):
-        import gc
         module = self.import_extension('foo', [
             ("fetchFooType", "METH_VARARGS",
              """
@@ -965,7 +964,9 @@
         for i in range(10):
             if module.getCounter() >= 2:
                 break
-            gc.collect()
+            # NB. use self.debug_collect() instead of gc.collect(),
+            # otherwise rawrefcount's dealloc callback doesn't trigger
+            self.debug_collect()
         assert module.getCounter() == 2
         #
         class Bar(Foo):
@@ -974,5 +975,5 @@
         for i in range(10):
             if module.getCounter() >= 4:
                 break
-            gc.collect()
+            self.debug_collect()
         assert module.getCounter() == 4
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to