[TIP] coverage.py: how to report unimported files

Ryan Campbell campbellr at gmail.com
Thu Aug 26 21:15:05 PDT 2010


Hi All,

I've just started using coverage.py on my project, and there is one
issue I've been struggling with. 

We've just started adding unit tests to our project and the vast
majority of the modules are still not tested. I would like to have the
coverage report display what modules in my project have 0% coverage, but
currently it only seems report the modules that are imported by the unit
test. Nose seems to have this functionality in it's coverage plugin
(--cover-inclusive sounds like what I am looking for), but since we
don't use nose, it doesn't help much.

One of the main reasons for this request is that the current behaviour
really skews our metrics. Currently coverage reports that we have 54%
code coverage, but since this doesn't include any of the completely
untested files in our project, the real percentage is probably closer to
8-10 percent.

Any suggestions?


Thanks,

Ryan




More information about the testing-in-python mailing list