[TIP] replacing "break" with "continue" causes line to not be covered w/ coverage.py

Laurens Van Houtven _ at lvh.cc
Sun Jul 3 06:18:49 PDT 2011

On Sun, Jul 3, 2011 at 3:09 PM, Eric Henry <henryer2 at msu.edu> wrote:

> Right, but the point is that you're not doing anything else if the
> condition is true.

Ugh, right. Sorry, eyes glazing over...

> I can't say for sure, but it would seem that it could easily convert the if
> ... continue into a "branch on equal" type bytecode. What happens if you
> have a print statement before the continue?

Same as with pretty much any modification to that body: line is covered.

> Eric

I'm probably just going to put # pragma: no cover there and be done with it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20110703/dcc5348d/attachment-0001.htm>

More information about the testing-in-python mailing list