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

Method test_del

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

Source from the content-addressed store, hash-verified

362 self.assertEqual(id(obj), id_L)
363
364 def test_del(self):
365 # __del__ methods can trigger collection, make this to happen
366 thresholds = gc.get_threshold()
367 gc.enable()
368 gc.set_threshold(1)
369
370 class A:
371 def __del__(self):
372 dir(self)
373 a = A()
374 del a
375
376 gc.disable()
377 gc.set_threshold(*thresholds)
378
379 def test_del_newclass(self):
380 # __del__ methods can trigger collection, make this to happen

Callers

nothing calls this directly

Calls 3

AClass · 0.70
enableMethod · 0.45
disableMethod · 0.45

Tested by

no test coverage detected