[TIP] Question about nosetests coverage output

Ned Batchelder ned at nedbatchelder.com
Wed Jan 6 10:30:10 PST 2016


On 1/6/16 1:01 PM, Fred Drake wrote:
> On Wed, Jan 6, 2016 at 12:23 PM, Ned Batchelder <ned at nedbatchelder.com> wrote:
>> It sounds like the second repo is using coverage.py 4.0.x.  Reports in 3.7
>> used module-style names (dots, no extension).  4.0 uses file-style names
>> (slashes, with extensions).  This was done because 4.0 supports reporting on
>> non-Python files, such as Django template files.
>>
>> The HTML report has the version of coverage in the footer.  You can check
>> there for sure what version is being used for each repo.
> Interesting.  I suspect I'm doing something horrible, but just haven't
> figured out what.
>
> The HTML footer definitely says "coverage.py v3.7.1" (screenshot attached, just
> for giggles).

Both footers say 3.7.1?
>
> This is the command I'm running:
>
>      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.
>
> This is using the python-coverage 3.7.1+dfsg.1-1ubuntu2 package installed from
> the Ubuntu repositories; since I re-build this VM regularly I know I
> don't have any
> leftover bits & pieces installed that I'd forgotten.
>
>
>    -Fred
>




More information about the testing-in-python mailing list