Skip to content

Commit

Permalink
test: one more fail-under test
Browse files Browse the repository at this point in the history
I saw this bug against pytest-cov, and thought it was my fault:
pytest-dev/pytest-cov#601, but pytest-cov has
their own comparison and reporting code for fail-under.  Without the
plugin, you won't get a message like "total of X is less than X."  This
test helped confirm that, so we'll keep it.
  • Loading branch information
nedbat committed Jun 27, 2023
1 parent 9e44b6e commit 294fece
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,7 @@ def test_fail_under(
"Coverage failure: total of 20.5 is less than fail-under=20.6\n"),
(20.12345, "report --fail-under=20.1235 --precision=5", 2,
"Coverage failure: total of 20.12345 is less than fail-under=20.12350\n"),
(20.12339, "report --fail-under=20.1234 --precision=4", 0, ""),
])
def test_fail_under_with_precision(self, result: float, cmd: str, ret: int, msg: str) -> None:
cov = CoverageReportingFake(report_result=result)
Expand Down

0 comments on commit 294fece

Please sign in to comment.