File: test_coverup_136.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 (22 lines) | stat: -rw-r--r-- 823 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
# file scalene/scalene_profiler.py:313-316
# lines [316]
# branches []

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

@pytest.fixture(scope="function")
def reset_scalene_config():
    # Store original value to restore after test
    original_trigger_length = scalene.scalene_config.NEWLINE_TRIGGER_LENGTH
    yield
    # Restore original value
    scalene.scalene_config.NEWLINE_TRIGGER_LENGTH = original_trigger_length

def test_update_line_executes_line_316(reset_scalene_config):
    # Set the trigger length to a non-zero value to ensure the bytearray is created
    scalene.scalene_config.NEWLINE_TRIGGER_LENGTH = 1
    # Call the method that should execute line 316
    Scalene.update_line()
    # No specific postconditions to assert; the test is for coverage of line 316