[pypy-svn] r59494 - pypy/trunk/lib-python/modified-2.5.2/test

arigo at codespeak.net arigo at codespeak.net
Tue Oct 28 17:56:23 CET 2008


Author: arigo
Date: Tue Oct 28 17:56:21 2008
New Revision: 59494

Modified:
   pypy/trunk/lib-python/modified-2.5.2/test/test_descr.py
Log:
No gc.get_objects().


Modified: pypy/trunk/lib-python/modified-2.5.2/test/test_descr.py
==============================================================================
--- pypy/trunk/lib-python/modified-2.5.2/test/test_descr.py	(original)
+++ pypy/trunk/lib-python/modified-2.5.2/test/test_descr.py	Tue Oct 28 17:56:21 2008
@@ -1321,15 +1321,18 @@
 
     # Test lookup leaks [SF bug 572567]
     import sys,gc
-    class G(object):
-        def __cmp__(self, other):
-            return 0
-    g = G()
-    orig_objects = len(gc.get_objects())
-    for i in xrange(10):
-        g==g
-    new_objects = len(gc.get_objects())
-    vereq(orig_objects, new_objects)
+    if check_impl_detail:    # no gc.get_objects() on non-CPython
+                             # implementations, but no leaks either :-)
+        class G(object):
+            def __cmp__(self, other):
+                return 0
+        g = G()
+        orig_objects = len(gc.get_objects())
+        for i in xrange(10):
+            g==g
+        new_objects = len(gc.get_objects())
+        vereq(orig_objects, new_objects)
+
     class H(object):
         __slots__ = ['a', 'b']
         def __init__(self):



More information about the Pypy-commit mailing list