Debian Codegraph @

tests/test_coverup_13.py

raw symbols SCIP
1 # file scalene/sparkline.py:10-21
2 # lines [10, 11, 12, 13, 14, 15, 16, 17, 20, 21]
3 # branches ['16->17', '16->20']
4
5 import pytest
6 from typing import List, Optional, Tuple
7 from scalene.sparkline import generate
8
9
10 def test_generate_all_zeros():
11 # Test with all zeros
12 arr = [0, 0, 0]
13 min_val, max_val, sparkline_str = generate(arr)
14 assert min_val == 0
15 assert max_val == 0
16 assert sparkline_str == ""
17
18
19 def test_generate_negative_values():
20 # Test with negative values
21 arr = [-1, -2, -3, 0, 1, 2, 3]
22 min_val, max_val, sparkline_str = generate(arr)
23 assert min_val >= 0
24 assert max_val >= 0
25 assert sparkline_str != ""
26 # No need to assert on sparkline_str content as it's a graphical representation
27
28
29 @pytest.fixture(autouse=True)
30 def run_around_tests():
31 # Setup code if needed
32 yield
33 # Teardown code if needed
34
35
36 # Run the tests
37 def test_generate():
38 test_generate_all_zeros()
39 test_generate_negative_values()