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

Eric Henry henryer2 at msu.edu
Sun Jul 3 06:09:40 PDT 2011


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

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?

Eric


On Sun, Jul 3, 2011 at 6:41 AM, Laurens Van Houtven <_ at lvh.cc> wrote:

> Hang on. This appears to be for *unconditional* jumps. My jump isn't
> unconditional, it's "if snr is None or prn is None:". How does that get
> optimized away? Where's the always-true condition? "prn is None or snr is
> None" is certainly not always true, in fact, that's the exception, not the
> norm.
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20110703/e8eecb4e/attachment.htm>


More information about the testing-in-python mailing list