[TIP] How do I get coverage on the test modules themselves?

Mcgregor, Cecil cmcgregor at paypal.com
Tue Sep 16 09:04:50 PDT 2014


Thank you very much for this reply. After many tries, I finally got coverage on my test files using an almost identical process as you describe. Since this was the first time I used the coverage tool, my ignorance go to me.

From: Gregory Salvan [mailto:apieum at gmail.com]
Sent: Tuesday, September 16, 2014 7:20 AM
To: Mcgregor, Cecil
Cc: testing-in-python at lists.idyll.org
Subject: Re: [TIP] How do I get coverage on the test modules themselves?

I recommend you to use nose plugin.
nosetest will detect test_*.py files automatically and report coverage if option --with-coverage activated.
A small example of usage: http://www.saltycrane.com/blog/2012/04/test-coverage-nose-and-coveragepy/
report to nose cover plugin documentation for more information.

2014-09-16 3:46 GMT+02:00 Mcgregor, Cecil <cmcgregor at paypal.com<mailto:cmcgregor at paypal.com>>:
I’m using coverage 3.7.1 with python 2.7.3 on Red Hat 4.1.2 linux

I’ve been attempting to get coverage on the test code themselves. So far coverage
seems to ignore these files.

It’s not obvious from the documentation how I can do this.

How do I cover the test_*.py files as part of the coverage reports?

Thanks

_______________________________________________
testing-in-python mailing list
testing-in-python at lists.idyll.org<mailto:testing-in-python at lists.idyll.org>
http://lists.idyll.org/listinfo/testing-in-python

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


More information about the testing-in-python mailing list