File: test_coverup_88.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-- 663 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:290-293
# lines [290, 291, 293]
# branches []

import pytest
from scalene.scalene_profiler import Scalene

@pytest.fixture(scope="function")
def scalene_cleanup():
    # Fixture to reset the state after the test
    original_in_jupyter = Scalene._Scalene__in_jupyter
    yield
    Scalene._Scalene__in_jupyter = original_in_jupyter

def test_set_in_jupyter(scalene_cleanup):
    # Ensure that __in_jupyter is initially False
    assert not Scalene._Scalene__in_jupyter
    # Call the method to set __in_jupyter to True
    Scalene.set_in_jupyter()
    # Check if __in_jupyter is now True
    assert Scalene._Scalene__in_jupyter