[TIP] Question about nosetests coverage output

Chris Withers chris at simplistix.co.uk
Fri Jan 8 08:01:38 PST 2016


On 06/01/2016 18:30, Ned Batchelder wrote:
> On 1/6/16 1:01 PM, Fred Drake wrote:      python2.7 setup.py nosetests 
> --cover-html --cover-html-dir=...
>>
>> My setup.cfg includes this configuration for nosetests:
>>
>>      [nosetests]
>>      tests = kt.testing.tests.foundation,
>>              kt.testing.tests.composite,
>>              kt.testing.tests.requests
>>
>>      detailed-errors = 1
>>      nocapture = 1
>>      verbosity = 1
>>
>>      # Coverage configuration.
>>      cover-branches = 1
>>      cover-erase = 1
>>      cover-package = kt.testing
>>      with-coverage = 1
>
> FWIW, I strongly prefer using coverage to run nose rather than the 
> other way around.  I guess that's to be expected :)  This may be an 
> effect of the nose coverage plugin somehow.
FWIW 2, I use the nose-cov plugin, which has slightly different options, 
but seems to work much better, and lets you just use the normal 
.coveragerc config. It's annoying that nose ships with a (not very good 
and providing annoyingly similar options) plugin. Here's what works for me:

https://travis-ci.org/Simplistix/testfixtures/jobs/100882039

Chris



More information about the testing-in-python mailing list