# Test iterators.
import unittest
-from test.support import run_unittest, TESTFN, unlink, gc_collect
+from test.support import run_unittest, TESTFN, unlink, cpython_only
# Test result of triple loop (too big to inline)
TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2),
(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):
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)
except ValueError:
pass
del l
- gc_collect()
self.assertEqual(C.count, 0)