-
-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incorrect branch reporting with __debug__ #522
Comments
Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary) Reproduced the issue as instructed at 24aff3d7bfd5 (bb) with python-2.7.12 and python-3.5 |
Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary) As of 813a3f0 (bb) the coverage shows 100%, the bug has been fixed and this issue can be closed |
Using the latest code, I still see the behavior originally reported. Leaving open. |
A simpler case will show the problem:
The "if 1:" statement doesn't appear in the compiled bytecode, so it's being removed from consideration, which makes the branch be attributed to 10->9 rather than 11->9. |
We treat constant expressions specially in while loops, but not in if's. |
Fixed in 7d90fa43b338 (bb). |
This was shipped in 4.3.2. |
Originally reported by John Theodore Goetz (Bitbucket: theodoregoetz, GitHub: theodoregoetz)
Coverage report indicates a missing branch with
__debug__
within anif
/else
block. Note if apass
is added after theif __debug__
then coverage is correctly shown as 100%.Running coverage in both
__debug__
and withpython -O
(appending the results):Results in the following:
The text was updated successfully, but these errors were encountered: