churchyard / rpms / python3

Forked from rpms/python3 6 years ago
Clone

Blame 00135-fix-test-within-test_weakref-in-debug-build.patch

5080ffc
diff -up Python-3.2b2/Lib/test/test_weakref.py.test-weakref-COUNT_ALLOCS_fix Python-3.2b2/Lib/test/test_weakref.py
5080ffc
--- Python-3.2b2/Lib/test/test_weakref.py.test-weakref-COUNT_ALLOCS_fix	2010-12-28 20:33:46.963364990 -0500
5080ffc
+++ Python-3.2b2/Lib/test/test_weakref.py	2010-12-28 20:35:44.115935248 -0500
5080ffc
@@ -583,9 +583,10 @@ class ReferencesTestCase(TestBase):
5080ffc
         # been cleared without their callbacks executing.  OTOH, the weakref
5080ffc
         # to C is bound to a function local (wr), and wasn't trash, so that
5080ffc
         # callback should have been invoked when C went away.
5080ffc
-        self.assertEqual(alist, ["C went away"])
5080ffc
-        # The remaining weakref should be dead now (its callback ran).
5080ffc
-        self.assertEqual(wr(), None)
5080ffc
+        if not hasattr(sys, 'getcounts'):
5080ffc
+            self.assertEqual(alist, ["C went away"])
5080ffc
+            # The remaining weakref should be dead now (its callback ran).
5080ffc
+            self.assertEqual(wr(), None)
5080ffc
 
5080ffc
         del alist[:]
5080ffc
         gc.collect()