MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_get_count

Method test_get_count

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected