[pypy-commit] pypy cpyext-debug-type_dealloc: minimal failing test; __init__ causes leak-checker to fail

mattip pypy.commits at gmail.com
Thu Aug 3 05:19:23 EDT 2017


Author: Matti Picus <matti.picus at gmail.com>
Branch: cpyext-debug-type_dealloc
Changeset: r92047:a12c2162e44e
Date: 2017-08-03 12:18 +0300
http://bitbucket.org/pypy/pypy/changeset/a12c2162e44e/

Log:	minimal failing test; __init__ causes leak-checker to fail

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
@@ -569,6 +569,20 @@
             ])
         assert module.test_type(type(None))
 
+    def test_leaking(self):
+        module = self.import_extension('foo', [
+            ("test_leak", "METH_VARARGS",
+             '''
+                 Py_RETURN_TRUE;
+             '''
+             )
+            ])
+        class C:
+            def __init__(self):
+                pass
+        # leak checker should not report errors
+        assert module.test_leak(C())
+    
     def test_tp_getattro(self):
         module = self.import_extension('foo', [
             ("test_tp_getattro", "METH_VARARGS",


More information about the pypy-commit mailing list