Blame SOURCES/00141-fix-test_gc_with_COUNT_ALLOCS.patch
|
|
23b3e9 |
diff -up Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS Python-2.7.2/Lib/test/test_gc.py
|
|
|
23b3e9 |
--- Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS 2011-09-08 19:49:13.045924309 -0400
|
|
|
23b3e9 |
+++ Python-2.7.2/Lib/test/test_gc.py 2011-09-08 19:50:07.035920617 -0400
|
|
|
23b3e9 |
@@ -102,11 +102,17 @@ class GCTests(unittest.TestCase):
|
|
|
23b3e9 |
del a
|
|
|
23b3e9 |
self.assertNotEqual(gc.collect(), 0)
|
|
|
23b3e9 |
del B, C
|
|
|
23b3e9 |
- self.assertNotEqual(gc.collect(), 0)
|
|
|
23b3e9 |
+ if hasattr(sys, 'getcounts'):
|
|
|
23b3e9 |
+ self.assertEqual(gc.collect(), 0)
|
|
|
23b3e9 |
+ else:
|
|
|
23b3e9 |
+ self.assertNotEqual(gc.collect(), 0)
|
|
|
23b3e9 |
A.a = A()
|
|
|
23b3e9 |
del A
|
|
|
23b3e9 |
- self.assertNotEqual(gc.collect(), 0)
|
|
|
23b3e9 |
- self.assertEqual(gc.collect(), 0)
|
|
|
23b3e9 |
+ if hasattr(sys, 'getcounts'):
|
|
|
23b3e9 |
+ self.assertEqual(gc.collect(), 0)
|
|
|
23b3e9 |
+ else:
|
|
|
23b3e9 |
+ self.assertNotEqual(gc.collect(), 0)
|
|
|
23b3e9 |
+ self.assertEqual(gc.collect(), 0)
|
|
|
23b3e9 |
|
|
|
23b3e9 |
def test_method(self):
|
|
|
23b3e9 |
# Tricky: self.__init__ is a bound method, it references the instance.
|