| 1 | # file scalene/sparkline.py:44-48 |
| 2 | # lines [47] |
| 3 | # branches ['46->47'] |
| 4 | |
| 5 | import pytest |
| 6 | from scalene.sparkline import _get_extent |
| 7 | |
| 8 | |
| 9 | def test_get_extent_zero_extent(): |
| 10 | # Test to cover the case where max_ and min_ are equal, triggering the if branch |
| 11 | max_val = 5.0 |
| 12 | min_val = 5.0 |
| 13 | expected_extent = 1.0 |
| 14 | assert ( |
| 15 | _get_extent(max_val, min_val) == expected_extent |
| 16 | ), "Extent should be set to 1 when max_ and min_ are equal" |