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

Marius Gedminas marius at gedmin.as
Tue Sep 16 08:50:48 PDT 2014


On Tue, Sep 16, 2014 at 06:45:07AM -0400, Ned Batchelder wrote:
> Others have explained the "don't cover your tests" mindset.  I like
> coverage-measuring my tests, for the simple reason that it gives me
> assurance that the tests are actually running.  If you've ever
> copy-pasted a test to make a new similar test, but forgot to change
> the method name, you've had tests that don't run.  Coverage can find
> those problems.

I also used to rely on eyeballing test coverage results to catch errors
like these, but pyflakes catches that in a more reliable fashion.

Test coverage is still useful in finding out which parts of your stubs
or helpers are no longer used.

Marius Gedminas
-- 
Linux don't need no steenkin' viruses. The users can destroy the
system all by themselves....
                -- Peter Dalgaard in comp.os.linux.misc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 173 bytes
Desc: Digital signature
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20140916/3cf5fdef/attachment.pgp>


More information about the testing-in-python mailing list