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

Method test_del_newclass

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

Source from the content-addressed store, hash-verified

377 gc.set_threshold(*thresholds)
378
379 def test_del_newclass(self):
380 # __del__ methods can trigger collection, make this to happen
381 thresholds = gc.get_threshold()
382 gc.enable()
383 gc.set_threshold(1)
384
385 class A(object):
386 def __del__(self):
387 dir(self)
388 a = A()
389 del a
390
391 gc.disable()
392 gc.set_threshold(*thresholds)
393
394 # The following two tests are fragile:
395 # They precisely count the number of allocations,

Callers

nothing calls this directly

Calls 3

AClass · 0.70
enableMethod · 0.45
disableMethod · 0.45

Tested by

no test coverage detected