Incremental code coverage for Python unit tests?
Brief
I use pycobertura.
pycobertura diff --format html --output cov_diff.html coverage_old.xml coverage_new.xml
Details
I use the following chain (coverage):
Generate coverage report:
python -m coverage run -m unittest
Output cobertura's XML format:
coverage xml --omit tests/* -o cover_old.xml
-- Modify code or checkout newer commit --
Generate coverage report:
python -m coverage run -m unittest
Output cobertura's XML format:
coverage xml --omit tests/* -o cover_new.xml
Generate diff:
pycobertura diff --format html --output cov_diff.html coverage_old.xml coverage_new.xml