1 from __future__ import annotations

2

3 from muutils.logger.timing import TimerContext

4

5

6 def test_timer_context() -> None:

7 with TimerContext() as timer:

8 x: float = 1.0

9 print(x)

10

11 assert isinstance(timer.start_time, float)

12 assert isinstance(timer.end_time, float)

13 assert isinstance(timer.elapsed_time, float)

14 assert timer.start_time <= timer.end_time

15 assert timer.elapsed_time >= 0.0