Coverage for tests/test_line_577.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.10.4, created at 2025-08-22 16:12 -0700

1import pytest 

2from fguess import get_test_value 

3 

4 

5class TestLine577Condition: 

6 """Test that line 577 condition can be False.""" 

7 

8 @pytest.mark.parametrize("test_input,expected", [ 

9 ("%", 0.0), # Just percent sign - clean becomes empty  

10 ("abc%", 0.0), # Non-numeric percentage - clean doesn't match NUMBER_RE 

11 (".%", 0.0), # Just decimal and percent - clean is "." which doesn't match 

12 ("+%", 0.0), # Plus and percent - clean becomes empty after removesuffix 

13 ]) 

14 def test_percentage_edge_cases_make_condition_false(self, test_input, expected): 

15 """Test cases where line 577 condition 'clean and NUMBER_RE.fullmatch(clean)' is False.""" 

16 result = get_test_value(test_input, "float") 

17 assert result == expected 

18 

19 # These cases should trigger the False branch at line 577 

20 # and return the default 0.0 from line 582