Skip to content

ptone/diff-coverage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diff Coverage Tool

This tool combines the data collected by coverage.py with a diff to determine what if any lines modified or added in the diff are not covered in a coverage run (generally the running of the test suite).

Currently the implementation assumes this is for a Django patch for convenience, as that is what I needed at the time - but modifying should be pretty easy.

Quickstart

First run the Django test suite with coverage:

coverage run runtests.py --settings=test_sqlite

Assuming you are using git for development generate a diff that you want to use for comparison:

git diff master > /path/to/my_patch.diff

then from inside this tool's directory, you need to have your patched version of django on your python path, for example if you use a django-dev virtualenv:

python diff_coverage.py /path/to/my_patch.diff

The script will write to stdout files with patched, untested lines and generate an html report with those files and the lines highlighted (with a red line number) in the current working directory.

About

A quick tool for checking the coverage of a patch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages