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

Method test_get_count

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

Source from the content-addressed store, hash-verified

400 @refcount_test
401 @requires_gil_enabled('needs precise allocation counts')
402 def test_get_count(self):
403 gc.collect()
404 a, b, c = gc.get_count()
405 x = []
406 d, e, f = gc.get_count()
407 self.assertEqual((b, c), (0, 0))
408 self.assertEqual((e, f), (0, 0))
409 # This is less fragile than asserting that a equals 0.
410 self.assertLess(a, 5)
411 # Between the two calls to get_count(), at least one object was
412 # created (the list).
413 self.assertGreater(d, a)
414
415 @refcount_test
416 def test_collect_generations(self):

Callers

nothing calls this directly

Calls 4

assertGreaterMethod · 0.80
collectMethod · 0.45
assertEqualMethod · 0.45
assertLessMethod · 0.45

Tested by

no test coverage detected