File: test_coverup_95.py

package info (click to toggle)
scalene 1.5.51-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,528 kB
  • sloc: cpp: 22,930; python: 13,403; javascript: 11,769; ansic: 817; makefile: 196; sh: 45
file content (21 lines) | stat: -rw-r--r-- 627 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# file scalene/scalene_profiler.py:1624-1627
# lines [1624, 1625, 1627]
# branches []

import pytest
from scalene.scalene_profiler import Scalene

@pytest.fixture(scope="function")
def scalene_cleanup():
    # Setup: None needed for this test
    yield
    # Teardown: Reset the __done flag to False after the test
    Scalene._Scalene__done = False

def test_is_done(scalene_cleanup):
    # Initially, __done should be False
    assert not Scalene.is_done()
    # Set the __done flag to True to simulate the end of profiling
    Scalene._Scalene__done = True
    # Now, is_done should return True
    assert Scalene.is_done()