-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
Confusing branching failure #493
Comments
Can you run the "coverage html" report and see what the line is annotated with? (Hover over the line in the coverage html report). |
Original comment by Joe Doherty (Bitbucket: docapotamus, GitHub: docapotamus) 2 missed branches: 1) line 69 didn't return from function 'check_token', because the return on line 59 wasn't executed or the return on line 62 wasn't executed, 2) line 69 didn't jump to line 74 line 71 didn't jump to line 74 I don't understand why it isn't noticing that line 74 will be run. I remember a problem here in the past (looking at the comment, sorry!) I wrote this code a while ago. |
Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary) Here is a minimal reproducer, confirmed with python-2.7.12 & python-3.5
|
Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary) There indeed is no way for the code to go from print('abc') to return None and PythonParser::analyze must not create that arc. |
Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary) For the record the proposed fix is at https://bitbucket.org/ned/coveragepy/pull-requests/108/finally-happens-before-return-in-a-try-493/diff |
finally happens before return in a try #493 In a try block such as: if expr: the print happens before the return and cannot be followed by close #493 → <<cset ac10ea1a8653 (bb)>> |
This fix was released as part of Coverage.py 4.3. |
Originally reported by Joe Doherty (Bitbucket: docapotamus, GitHub: docapotamus)
Hello,
I have a strange issue with coverage since upgrading to 4.1
I am getting a branch failure which I know I have a test for. The file: https://codecov.io/gh/pjuu/pjuu/src/508aafc3f35814677fa6d29e555e8636efab0bb8/pjuu/lib/tokens.py
If I change the code and remove the else and add a print, the print shows. However I get a failure on the print saying it isn't covered.
Not sure if this is intended and I can't see any obvious as to why this would fail.
Thanks in advance.
The text was updated successfully, but these errors were encountered: