Skip to content
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

Precise coverage percentage value #631

Closed
nedbat opened this issue Jan 21, 2018 · 3 comments
Closed

Precise coverage percentage value #631

nedbat opened this issue Jan 21, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Jan 21, 2018

Originally reported by Anonymous


Hi,

Situation:

  • changing code
  • running tests with coverage
  • final result: all fine

But that's (sometimes) not true because:

  • I'm using coveralls.io and it says (as example) that I have a coverage of 94.708%
  • in coverage.py I can say --fail-under=95 and the coverage doesn't fail because it obviously does rounding to an integer.

It's a bit uncomfortable when you run all things locally before you commit your changes but finally fail because of such an issue. It happens to me several times.

I see following essential improvements you could do:

  • enable to define precise coverage for --fail-under
  • displaying precise coverage

kind regards,

Thomas (mail: thomas.lehmann.private@gmail.com)


@nedbat
Copy link
Owner Author

nedbat commented Jan 21, 2018

Original comment by Thomas Lehmann (Bitbucket: Carolinus, GitHub: Carolinus)


I can't say whether it's really an issue on the coverage.py, something with coveralls.io or the way I'm using the tool.
Here some insights (I hope it does help):

@nedbat
Copy link
Owner Author

nedbat commented Jan 21, 2018

As of 5a70eeb5300d (bb), fail_under can be a float. Be careful using it, that coverage and coveralls don't round differently? Floats are tricky...

@nedbat
Copy link
Owner Author

nedbat commented Feb 3, 2018

This was included in coverage.py v4.5, released today.

@nedbat nedbat closed this as completed Feb 3, 2018
@nedbat nedbat added major bug Something isn't working labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant