Author: Antonio Cuni <[email protected]>
Branch: cpyext-avoid-roundtrip
Changeset: r92688:abffbc3948ea
Date: 2017-10-09 18:40 +0200
http://bitbucket.org/pypy/pypy/changeset/abffbc3948ea/

Log:    (antocuni, arigo): write a passing test

diff --git a/pypy/module/cpyext/test/test_intobject.py 
b/pypy/module/cpyext/test/test_intobject.py
--- a/pypy/module/cpyext/test/test_intobject.py
+++ b/pypy/module/cpyext/test/test_intobject.py
@@ -66,6 +66,21 @@
         assert p_x == p_y
         decref(space, p_y)
 
+    def test_freelist_int_subclass(self, space):
+        w_MyInt = space.appexec([], """():
+            class MyInt(int):
+                pass
+            return MyInt""")
+        w_x = space.call_function(w_MyInt, space.newint(12345678))
+        w_y = space.call_function(w_MyInt, space.newint(87654321))
+        p_x = make_ref(space, w_x)
+        decref(space, p_x)
+        p_y = make_ref(space, w_y)
+        # now the address is different because the freelist does not work for
+        # int subclasses
+        assert p_x != p_y
+        decref(space, p_y)
+
     def test_coerce(self, space):
         w_obj = space.appexec([], """():
             class Coerce(object):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to