| 1 | # file scalene/scalene_profiler.py:1624-1627 |
| 2 | # lines [1624, 1625, 1627] |
| 3 | # branches [] |
| 4 | |
| 5 | import pytest |
| 6 | from scalene.scalene_profiler import Scalene |
| 7 | |
| 8 | |
| 9 | @pytest.fixture(scope="function") |
| 10 | def scalene_cleanup(): |
| 11 | # Setup: None needed for this test |
| 12 | yield |
| 13 | # Teardown: Reset the __done flag to False after the test |
| 14 | Scalene._Scalene__done = False |
| 15 | |
| 16 | |
| 17 | def test_is_done(scalene_cleanup): |
| 18 | # Initially, __done should be False |
| 19 | assert not Scalene.is_done() |
| 20 | # Set the __done flag to True to simulate the end of profiling |
| 21 | Scalene._Scalene__done = True |
| 22 | # Now, is_done should return True |
| 23 | assert Scalene.is_done() |