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

Method test_del

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

get_thresholdMethod · 0.80
set_thresholdMethod · 0.80
AClass · 0.70
enableMethod · 0.45
disableMethod · 0.45

Tested by

no test coverage detected