How to exclude a file from coverage report ??

2,193 views
Skip to first unread message

Ishant

unread,
Apr 9, 2012, 10:51:46 AM4/9/12
to nose-users
Hi,

I am using nosetests to run the test cases and generate the coverage
report for a package .Tests package is inside the package which I want
to cover.


nosetests --cover-package=network --cover-erase --with-xcoverage


There is a file in network package which I want to exclude from
coverage report.I have tried omit option in .covergerc but report
still shows the file and coverage as 0% .

.coveragerc

[run]
branch = True
source = network
omit = */firewall.py

[report]
source = network
omit = */firewall.py



How can I exclude this file from coverage report?? Is there any nose
plugin to exclude the file or some configuration in .coveragerc ??


Thanks,
Ishant

Philip Stephens

unread,
Apr 10, 2012, 8:19:22 PM4/10/12
to nose-...@googlegroups.com
I use the nose-exclude plugin (available on PyPi) to do this. 

I have a file called 'nose-exclude.txt' in the same dir as setup.py. It is a one-line file with a file path. 

Reply all
Reply to author
Forward
0 new messages