[TIP] nosetests with coverage excluding a package

Joesan Gabaldon joesan.gabaldon at gmail.com
Tue Jul 19 15:25:10 PDT 2011


Hey all, I've been trying to figure this out on and off for a couple months
now (it hasn't really been priority until recently) and I could really use
some help fixing this.

I'm running a system which requires 2 serves to run, one of them being a
pylons project.  For some reason coverage doesn't seem to be checking any of
the files in the pylons server.  I have a script which launches both servers
using Popen, with the pylons server launched with the shell command "paster
serve development.ini".

Nosetests & coverage are launched with:

    nosetests -v thisproject/tests_folder --with-coverage --with-xunit
--xunit-file=./nosetests.xml
    coverage xml --include=thisproject/* --omit=./thisproject/tests_folder/*


I've also tried explicitly telling the coverage report to include the pylons
folder which is located at "thisproject/clients/pylons_server":

    coverage xml --include=thisproject/*,thisproject/clients/pylons_server
--omit=./thisproject/tests_folder/*

But that doesn't seem to work, I suspect because that folder is never even
executed when nosetests is running the tests.  The functions are definitely
getting executed though as those tests pass, and other files in the clients
folder and subdirectories of clients are getting included in the coverage
report.  Anyone have any ideas?

Joesan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20110719/82383d98/attachment.htm>


More information about the testing-in-python mailing list