[TIP] coverage.py has slightly different results when being called from setup.py and not...

Tom Swirly tom at swirly.com
Sat Jan 28 09:36:17 PST 2017

Greetings, testy people.  Thanks for this excellent package!

I discovered coverage.py last week and have been dropping it into various
projects I'm on.  One of them only has a strangeness and I'd like to figure
it out.

The project is quite vanilla and doesn't use any of the trouble techniques
listed here:  https://coverage.readthedocs.io/en/coverage-4.3.4/trouble.html

--timid had no effect.

The issue: when I run coverage from setup.py <http://coverage run -m
unittest discover test \*_test.py> this file gamma.py
<https://github.com/ManiacalLabs/BiblioPixel/blob/dev/bibliopixel/gamma.py> is
marked as having only 6% coverage - nothing except line 14

I don't even see how that would be possible, but more, there's an explicit
test that at least loads the file
even if it doesn't test the values - and yes, I can see that test run in my

If I run coverage.py from the command line, like this:

coverage run -m unittest discover test \*_test.py .

 I see 100% coverage as expected.

Generally, I hate hitting up mailing lists until I have had a chance to
debug the package I'm whining about ;-), but in this case I'm really not
quite sure how to debug coverage.py, and I see no bug report I can camp on.
 (I don't think this one
is it...)

Thanks in advance!


http://radio.swirly.com - art music radio 24/7 366/1000
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20170128/cd32eb3a/attachment.html>

More information about the testing-in-python mailing list