[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.
I'm probably just going to put # pragma: no cover there and be done with it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python