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

Method test_global_del_SystemExit

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

Source from the content-addressed store, hash-verified

832 self.assertNotIn(b"elapsed", err)
833
834 def test_global_del_SystemExit(self):
835 code = """if 1:
836 class ClassWithDel:
837 def __del__(self):
838 print('__del__ called')
839 a = ClassWithDel()
840 a.link = a
841 raise SystemExit(0)"""
842 self.addCleanup(unlink, TESTFN)
843 with open(TESTFN, 'w', encoding="utf-8") as script:
844 script.write(code)
845 rc, out, err = assert_python_ok(TESTFN)
846 self.assertEqual(out.strip(), b'__del__ called')
847
848 def test_get_stats(self):
849 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