MCPcopy Index your code
hub / github.com/python/cpython / test_threshold_zero

Method test_threshold_zero

Lib/test/test_gc.py:1629–1639  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1627 # Ensure that setting *threshold0* to zero disables collection.
1628 @gc_threshold(0)
1629 def test_threshold_zero(self):
1630 junk = []
1631 i = 0
1632 detector = GC_Detector()
1633 while not detector.gc_happened:
1634 i += 1
1635 if i > 50000:
1636 break
1637 junk.append([]) # this may eventually trigger gc (if it is enabled)
1638
1639 self.assertEqual(i, 50001)
1640
1641
1642class PythonFinalizationTests(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

GC_DetectorClass · 0.85
appendMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected