File: test_coverup_93.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 (24 lines) | stat: -rw-r--r-- 799 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
22
23
24
# file scalene/scalene_profiler.py:313-316
# lines [313, 314, 316]
# branches []

import pytest
import scalene.scalene_config
from scalene.scalene_profiler import Scalene

@pytest.fixture(autouse=True)
def run_around_tests():
    # Setup: Store original value
    original_trigger_length = scalene.scalene_config.NEWLINE_TRIGGER_LENGTH
    # Give a new value for the test
    scalene.scalene_config.NEWLINE_TRIGGER_LENGTH = 1
    yield
    # Teardown: Restore original value
    scalene.scalene_config.NEWLINE_TRIGGER_LENGTH = original_trigger_length

def test_update_line():
    # Call the method to test
    Scalene.update_line()
    # No direct postconditions to assert; the function's purpose is to trigger memory allocation
    # We can only assert that no exception was raised
    assert True