From 9f29efdf20c5dcfe49e85cc61c0839730be2462e Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Sun, 23 Dec 2018 20:19:39 -0500 Subject: Disallow impossible values for fail_under Since there's no way were likely to achieve greater than 100% code coverage, disallow usage of any value above 100. Resolves #743 Signed-off-by: Mike Fiedler --- tests/test_results.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/test_results.py b/tests/test_results.py index 307ef762..f83b73dd 100644 --- a/tests/test_results.py +++ b/tests/test_results.py @@ -105,3 +105,8 @@ class NumbersTest(CoverageTest): ]) def test_should_fail_under(total, fail_under, precision, result): assert should_fail_under(float(total), float(fail_under), precision) == result + + +def test_should_fail_under_invalid_value(): + with pytest.raises(ValueError): + should_fail_under(100.0, 101, 0) -- cgit v1.2.1