File: test_coverup_90.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 (16 lines) | stat: -rw-r--r-- 605 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# file scalene/scalene_profiler.py:295-298
# lines [295, 296, 298]
# branches []

import pytest
from scalene.scalene_profiler import Scalene

# Test function to check if Scalene.in_jupyter() returns the correct value
def test_in_jupyter(monkeypatch):
    # Set up the environment to simulate running inside Jupyter
    monkeypatch.setattr(Scalene, '_Scalene__in_jupyter', True)
    assert Scalene.in_jupyter() is True

    # Clean up by setting the environment to simulate not running inside Jupyter
    monkeypatch.setattr(Scalene, '_Scalene__in_jupyter', False)
    assert Scalene.in_jupyter() is False