[TIP] confusing coverage message

Ned Batchelder ned at nedbatchelder.com
Tue Jan 29 10:54:00 PST 2013


On 1/29/2013 1:19 PM, Chris Withers wrote:
> On 29/01/2013 13:06, Chris Withers wrote:
>> On 29/01/2013 12:54, Ned Batchelder wrote:
>>> I can explain that message. It means, bug #92 still hasn't been fixed:
>>> https://bitbucket.org/ned/coveragepy/issue/92/finally-clauses-arent-treated-properly-in 
>>>
>>>
>>> :(
>>>
>>> It is at the top of my TODO list, but might be difficult... In the
>>> meantime, you can add a pragma comment ("#pragma: no branch") to quiet
>>> it if you need to.
>
> Hmm, this one looks like a real bug:
>
> http://jenkins.simplistix.co.uk/job/checker-buildout/PYTHON=2.7,label=linux/75/coveragepy/checker_checkers_jenkins.html 
>
>
> I wouldn't expect line 40 to *ever* jump to line 70 there...
>

Yes, that looks like a real bug too, bug #146: 
https://bitbucket.org/ned/coveragepy/issue/146/context-managers-confuse-branch-coverage 
, though it's hard to know for sure if they have the same root cause.  
I'm analyzing bytecode to understand what can jump where, and nested 
blocks like for/with and for/finally are clearly not being handled 
right.  I'd be glad for some help understanding the nuances....

--Ned.

> Chris
>




More information about the testing-in-python mailing list