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

Method test_get_objects_generations

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

Source from the content-addressed store, hash-verified

901
902 @requires_gil_enabled('need generational GC')
903 def test_get_objects_generations(self):
904 gc.collect()
905 l = []
906 l.append(l)
907 self.assertTrue(
908 any(l is element for element in gc.get_objects(generation=0))
909 )
910 gc.collect()
911 self.assertFalse(
912 any(l is element for element in gc.get_objects(generation=0))
913 )
914 del l
915 gc.collect()
916
917 def test_get_objects_arguments(self):
918 gc.collect()

Callers

nothing calls this directly

Calls 5

assertTrueMethod · 0.80
assertFalseMethod · 0.80
anyFunction · 0.50
collectMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected