nose
nose copied to clipboard
--cover-omit support
I'd like to propose Nose to support the --omit argument from coverage.py, so that we can specify patterns to exclude files from coverage report.
Use case: South migrations created for Django are created inside packages from inside the project, but they're created automatically. Also, they're created by a third-party application, which maintains the tests for them. So, it makes no sense to give these files any coverage from within the project, since Django itself handles these files.
Does this make sense?
Thanks, guys! :-)
Sounds good to me. Though as someone who has been burned by many a bad migration, I have to suggest running them with your tests, at least in continuous integration. :)
Indeed a good point, jpellerin, but the problem is how we make coverage for the "down" functions, which IMO are a bit over-testing
Yes please, this is a badly needed feature :)
Even better would be to support a .coveragerc
file: http://nedbatchelder.com/code/coverage/config.html
em.. will this feature be supported?
I'm looking forward to this feature too...
I'd like this to be added too.
I'd like this to be supported too.
+1
Yet another +1!
+1
+1
:+1:
I don't mind adding this support, but is there any reason why you just don't run coverage outside of nose? In fact, Ned Batchelder recommended it at some point--though I can't find the reference. It definitely gets you more control of coverage's configuration and results.
Could you elaborate on what you mean by running coverage outside of nose?
You can do: coverage run -m nose
.
Also, you can setup a .coveragerc file to inject options into coverage. I currently use this on a project:
[run]
omit =
build.py
fabfile.py
pavement.py
setup.py
foobar/tests/*
@dbrgn It seems like .coveragerc
gets read if you run the coverage from nose...
+1
+1
+1
@mforbes is right, .coveragerc
works
+1
+1
+1
If you want to exclude completely: https://pypi.org/project/nose-exclude/
Another alternative I found is to specify the folders you want to include in your coverage report. Add the following line to your .noserc file:
cover-package=jobs,shared