pytest-cov icon indicating copy to clipboard operation
pytest-cov copied to clipboard

Removing message formatting rounding

Open didibz-harmonya opened this issue 2 years ago • 3 comments

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.

didibz-harmonya avatar Sep 19 '23 12:09 didibz-harmonya

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

Colin-b avatar Feb 01 '24 17:02 Colin-b

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

Colin-b avatar Feb 07 '24 16:02 Colin-b

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?

Colin-b avatar Feb 23 '24 14:02 Colin-b