nedbat / coveragepy

The code coverage tool for Python
https://coverage.readthedocs.io
Apache License 2.0
3.01k stars 433 forks source link

Comparison of coverage result with previous/historical run #848

Closed henrywkk closed 5 years ago

henrywkk commented 5 years ago

Scenario I like to use coverage with pytest to access the test coverage of my unit tests. Every time I made code changes I would re-run the coverage report to check if the test cases can cover new codes well. However, the issue is that I have to spot manually if any .py file has particularly low coverage.

Proposed solution Can we have a comparison with previous/historical run added in the coverage report? I can easily spot if any .py file has significantly dropped coverage in this case.

Please let me know if this feature already exists in coveragepy or any plugin on top of it. Thanks.

nedbat commented 5 years ago

Services like codecov.io provide this feature, and projects like diff-cover highlight lines in your most recent change that are missing coverage.

Since this is a feature that can be built outside of coverage.py, I would rather keep it outside. What do you think?

henrywkk commented 5 years ago

Agreed to segregate the feature if it can built outside. I will take a look to codecov.io/diff-cover and close the issue for now. Thanks a lot for your feedback.

Bachmann1234 commented 5 years ago

👀 let me know if you have questions about diff cover (I'm the maintainer). Though I've been impressed by codecov.io