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

Method test_del_newclass

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

Source from the content-addressed store, hash-verified

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

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