[TIP] confusing coverage message

Marius Gedminas marius at gedmin.as
Tue Jan 29 05:07:34 PST 2013


On Tue, Jan 29, 2013 at 08:33:45AM +0000, Chris Withers wrote:
> Hi Ned,

I'm not Ned, but I think I can answer this.

> Can you explain to me what's going on here:
> 
> http://jenkins.simplistix.co.uk/job/checker-buildout/PYTHON=2.7,label=linux/67/coveragepy/checker_checkers_jenkins.html#n57
> 
> What does "no jump to this line number" mean?

It means that none of the execution paths recorded by coverage jumped
from bytecode corresponding for that line (line 57) to bytecode
corresponding to line 75.

> I have a few tests which exercise that finally clause, so I'm a
> little confused.

Here's the code:

    24: def check(config_folder, jenkins_home):
            ...
    35:     for plugin_path in _paths(jenkins_home, ['plugins', '*.jpi']): 
                ...
    38:         try:
                    ...
    56:         finally:
    57:             zip.close()        # no jump to line 75
            ...
    74: # blank line after end of function

The message means that your test suite has no tests that would result in
a code path that would jump to line 75 (i.e. end of function) directly
after executing the 'zip.close()'.  In other words, you're not testing
the case where an exception is raised inside the try:/finally: between
lines 39 and 55.

Marius Gedminas
-- 
Committee, n.:
        A group of men who individually can do nothing but as a group
        decide that nothing can be done.
                -- Fred Allen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20130129/078ac1de/attachment.pgp>


More information about the testing-in-python mailing list