-
Notifications
You must be signed in to change notification settings - Fork 213
cov-fail-under should round before comparing #601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you show us the exact actual message you are seeing? |
is the actual message, nothing else. Maybe I misunderstood?! |
No, you're good, my mistake. |
nedbat
added a commit
to nedbat/coveragepy
that referenced
this issue
Jun 27, 2023
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.
nedbat
added a commit
to nedbat/coverage-reports
that referenced
this issue
Jun 27, 2023
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. https://htmlpreview.github.io/?https://github.com/nedbat/coverage-reports/blob/main/reports/20230627_44aa528a44/htmlcov/index.html 44aa528a44: master
nedbat
added a commit
to nedbat/coveragepy
that referenced
this issue
Jun 27, 2023
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.
nedbat
added a commit
to nedbat/coveragepy
that referenced
this issue
Jun 27, 2023
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.
nedbat
added a commit
to nedbat/coveragepy
that referenced
this issue
Jun 28, 2023
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.
nedbat
added a commit
to nedbat/coveragepy
that referenced
this issue
Jun 28, 2023
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.
nedbat
added a commit
to nedbat/coveragepy
that referenced
this issue
Jun 28, 2023
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.
nedbat
added a commit
to nedbat/coveragepy
that referenced
this issue
Jun 28, 2023
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.
This PR should solve this reporting issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Our tests fail with a message similar to
FAIL Required test coverage of 54.18% not reached. Total coverage: 54.18%
as you can see from this message, it actually looks like the coverage is reached. It should only fail if the coverage is less, not if it's equal.
My guess is that these numbers are rounded and are actually not equal.
Expected vs actual result
Actual: Fails when coverage is qual expected value
Expected: Only fail if it is less
Reproducer
Versions
pytest-cov==4.1.0
pytest==7.3.2
The text was updated successfully, but these errors were encountered: