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

Method test_global_del_SystemExit

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

Source from the content-addressed store, hash-verified

828 self.assertNotIn(b"elapsed", err)
829
830 def test_global_del_SystemExit(self):
831 code = """if 1:
832 class ClassWithDel:
833 def __del__(self):
834 print('__del__ called')
835 a = ClassWithDel()
836 a.link = a
837 raise SystemExit(0)"""
838 self.addCleanup(unlink, TESTFN)
839 with open(TESTFN, 'w', encoding="utf-8") as script:
840 script.write(code)
841 rc, out, err = assert_python_ok(TESTFN)
842 self.assertEqual(out.strip(), b'__del__ called')
843
844 def test_get_stats(self):
845 stats = gc.get_stats()

Callers

nothing calls this directly

Calls 6

assert_python_okFunction · 0.90
addCleanupMethod · 0.80
openFunction · 0.50
writeMethod · 0.45
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected