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

Feature: add diff_cover?

Open tlambert03 opened this issue 2 years ago • 4 comments

I'm wondering if you've considered (or would consider a PR) implementing support for diff_cover?

I'm thinking something like pytest --cov --cov-report=term-diff, which would essentially run diff_cover and add it to the report? I took a stab at implementing this as an independent pytest plugin (that would in turn use pytest-cov), but found that it was rather difficult (and probably bad form) to essentially modify the pytest-cov plugin instance to achieve this.

I'm happy to open PR trying to implement this, but wanted to gauge interest first. thanks!

tlambert03 avatar Jun 26 '23 13:06 tlambert03

Instead of further complicating pytest-cov, why not run diff-cover as a command of its own?

nedbat avatar Jun 26 '23 13:06 nedbat

yep, a two step process is definitely an alternative :) ... but you could make a similar argument for reports in general right? Why not just run coverage report after running pytest --cov to generate the xml?

tlambert03 avatar Jun 26 '23 15:06 tlambert03