Coverage for tests / decorator_test / disable_timer.py: 90%
10 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-30 08:37 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-30 08:37 +0000
1"""Methods used to test that the appropriate envvar disables the timing
2decorator.
3"""
5import logging
6import time
8from lsst.utils.timer import timeMethod
10log = logging.getLogger("disable_timer")
13@timeMethod(logger=log, logLevel=logging.INFO)
14def sleep_and_log(self, duration: float) -> None:
15 """Check that this does not log if the decorator was disabled on import."""
16 time.sleep(duration)
19@timeMethod
20def sleep_and_nothing(self, duration: float) -> None:
21 """Check that this does not have a `__wrapped__` attribute to confirm that
22 the decorator is disabled.
23 """
24 time.sleep(duration)