File: test_coverup_61.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-- 552 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_json.py:63-68
# lines [63, 65, 68]
# branches []

import pytest
from unittest.mock import Mock, patch

# Mock the cloudpickle import in scalene_statistics
with patch.dict('sys.modules', {'cloudpickle': Mock()}):
    from scalene.scalene_json import ScaleneJSON

@pytest.fixture
def scalene_json_cleanup():
    # Setup code if necessary
    yield
    # Cleanup code if necessary

def test_scalene_json_init(scalene_json_cleanup):
    json_obj = ScaleneJSON()
    assert json_obj.output_file == ""
    assert json_obj.gpu is False