]> granicus.if.org Git - python/commitdiff
mark ref counting as impl detail
authorBenjamin Peterson <benjamin@python.org>
Tue, 22 Jun 2010 20:32:02 +0000 (20:32 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 22 Jun 2010 20:32:02 +0000 (20:32 +0000)
Lib/test/test_iter.py

index a56b89ee802c2b3a40d1483f3fabe5901cfdd0c7..64984cc6e6a54869d9e6eff962b3a0f1d5f69086 100644 (file)
@@ -2,7 +2,7 @@
 
 import unittest
 from test.test_support import run_unittest, TESTFN, unlink, have_unicode, \
-                              check_py3k_warnings, gc_collect
+                              check_py3k_warnings, cpython_only
 
 # Test result of triple loop (too big to inline)
 TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2),
@@ -793,8 +793,9 @@ class TestCase(unittest.TestCase):
         (a, b), (c,) = IteratingSequenceClass(2), {42: 24}
         self.assertEqual((a, b, c), (0, 1, 42))
 
-        # Test reference count behavior
 
+    @cpython_only
+    def test_ref_counting_behavior(self):
         class C(object):
             count = 0
             def __new__(cls):
@@ -807,7 +808,6 @@ class TestCase(unittest.TestCase):
         x = C()
         self.assertEqual(C.count, 1)
         del x
-        gc_collect()
         self.assertEqual(C.count, 0)
         l = [C(), C(), C()]
         self.assertEqual(C.count, 3)
@@ -816,7 +816,6 @@ class TestCase(unittest.TestCase):
         except ValueError:
             pass
         del l
-        gc_collect()
         self.assertEqual(C.count, 0)