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

Class CounterWithDisable

Lib/test/test_monitoring.py:378–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376
377
378class CounterWithDisable:
379
380 def __init__(self):
381 self.disable = False
382 self.count = 0
383
384 def __call__(self, *args):
385 self.count += 1
386 if self.disable:
387 return sys.monitoring.DISABLE
388
389
390class RecorderWithDisable:

Callers 10

test_disableMethod · 0.85
test_restartMethod · 0.85
test_two_sameMethod · 0.85
test_three_sameMethod · 0.85
test_two_differentMethod · 0.85
test_two_with_disableMethod · 0.85
check_disableMethod · 0.85

Calls

no outgoing calls

Tested by 10

test_disableMethod · 0.68
test_restartMethod · 0.68
test_two_sameMethod · 0.68
test_three_sameMethod · 0.68
test_two_differentMethod · 0.68
test_two_with_disableMethod · 0.68
check_disableMethod · 0.68