nosetests - excluding a dir from the coverage report

758 views Asked by At

I have my python app structured as follows:

proj
   - comp1
   - comp2
tests
   - comp1
   - comp2
other
   - contains some python code

I am running nosetests as following:

nosetests --with-coverage  --cover-package=proj --exclude-dir=other -v tests

However, in the coverage report that nosetests prints at the end I still entries from 'other'. How do I exclude 'other' from the coverage report?

1

There are 1 answers

1
Oleksiy On

Quite possible your tests or proj are referring to the other python code, and as result, it makes it into report. You could see debug coverage plugin printout with:

nosetests --with-coverage  --cover-package=proj -vv tests -l nose.plugins.cover