pytest-dev / pytest-cov

Coverage plugin for pytest.
MIT License
1.72k stars 211 forks source link

Removing message formatting rounding #611

Open didibz-harmonya opened 11 months ago

didibz-harmonya commented 11 months ago

When defining a coverage threshold (88.45 for example) and the actual coverage is very close (88.449 for example) we will get a failure message. However, the message will be: "FAIL Required test coverage of 88.45% not reached. Total coverage: 88.45%" where it's wrong and confusing since we failed because it's under while it the message it presented as equal. The removing of the rounding will fix it.

Colin-b commented 6 months ago

Hello @AdiKrasin, can this fix get merged and released?

Colin-b commented 6 months ago

@ionelmc Can you have a look at this? Thanks again

Colin-b commented 6 months ago

If you are not ok with this change, I'll gladly come up with a PR fixing it as well matching your expectations. This is a long standing issue that is quite painful with long running test suites (because it's a pain to relaunch it to know the coverage) that are distributed (so cannot run with coverage only).

I'd argue a more in-line change would be to read the coverage "precision" setting and report it the same way coverage is. Is that something you would be willing to merge and release?