Debian Codegraph @

tests/test_coverup_68.py

raw symbols SCIP
1 # file scalene/scalene_statistics.py:365-374
2 # lines [371, 372, 373, 374]
3 # branches ['371->exit', '371->372', '372->371', '372->373']
4
5 import pytest
6 from scalene.scalene_statistics import ScaleneStatistics
7 from typing import Dict
8
9
10 @pytest.fixture
11 def cleanup():
12 # Fixture to clean up any changes after the test
13 yield
14 # No specific cleanup code needed as the test does not modify any global state
15
16
17 def test_increment_per_line_samples(cleanup):
18 # Define the source and destination dictionaries
19 src = {"file1.py": {1: 10, 2: 20}, "file2.py": {1: 5}}
20 dest = {"file1.py": {1: 1, 2: 2}, "file2.py": {1: 0}}
21
22 # Expected result after incrementing
23 expected_dest = {"file1.py": {1: 11, 2: 22}, "file2.py": {1: 5}}
24
25 # Call the method to test
26 ScaleneStatistics.increment_per_line_samples(dest, src)
27
28 # Assert that the destination has been correctly incremented
29 assert dest == expected_dest