How can I exclude South migrations from coverage reports using coverage.py How can I exclude South migrations from coverage reports using coverage.py python python

How can I exclude South migrations from coverage reports using coverage.py


The solution was:

[run]omit = ../*migrations*


You should be able to match against the migrations directory to omit those files. Have you tried quoting the argument? Depending on your OS and shell, it may be expanding those asterisks prematurely. Try it like this:

--omit='*migrations*'

Alternately, you could put the switch into a .coveragerc file:

[run]omit = *migrations*


Latest version of django-jenkins has new option COVERAGE_WITH_MIGRATIONS that would exclude migrations. It's not in PyPI yet so you need to install it with pip/easy_install specyfing url git url as source.