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

Method test_is_finalized

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

Source from the content-addressed store, hash-verified

645 self.assertTrue(gc.is_tracked(UserIntSlots()))
646
647 def test_is_finalized(self):
648 # Objects not tracked by the always gc return false
649 self.assertFalse(gc.is_finalized(3))
650
651 storage = []
652 class Lazarus:
653 def __del__(self):
654 storage.append(self)
655
656 lazarus = Lazarus()
657 self.assertFalse(gc.is_finalized(lazarus))
658
659 del lazarus
660 gc.collect()
661
662 lazarus = storage.pop()
663 self.assertTrue(gc.is_finalized(lazarus))
664
665 def test_bug1055820b(self):
666 # Corresponds to temp2b.py in the bug report.

Callers

nothing calls this directly

Calls 5

LazarusClass · 0.85
assertFalseMethod · 0.80
collectMethod · 0.80
assertTrueMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected