| 1 | # file scalene/scalene_statistics.py:238-240 |
| 2 | # lines [240] |
| 3 | # branches [] |
| 4 | |
| 5 | import time |
| 6 | from scalene.scalene_statistics import ScaleneStatistics |
| 7 | import pytest |
| 8 | |
| 9 | |
| 10 | @pytest.fixture |
| 11 | def scalene_statistics(): |
| 12 | stats = ScaleneStatistics() |
| 13 | yield stats |
| 14 | # No specific cleanup needed after the test |
| 15 | |
| 16 | |
| 17 | def test_start_clock(scalene_statistics): |
| 18 | before_time = time.time() |
| 19 | scalene_statistics.start_clock() |
| 20 | after_time = time.time() |
| 21 | # Assert that start_time is between before_time and after_time |
| 22 | assert before_time <= scalene_statistics.start_time <= after_time |