-
-
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
"Jump to the function exit" in lcov report for branch at top level of module #1874
Comments
I've also observed similar issues in unit tests when the last statement in a function is a |
Hmm, this has been a bug for a long time. In 6.0.0 (Oct '21) through 6.4.1 (June '22), the message was "didn't jump to line 0". In 6.4.2 (July '22), it changed to "didn't jump to the function exit," and it's been that way ever since. |
This is fixed in commit c85eaba. |
This is now released as part of coverage 7.6.10. |
This rather peculiar test case was delta-minimized from real code (appdirs.py 1.4.1). It is formatting sensitive. In particular, removing the
#!
line or moving the close parenthesis that's currently on a line by itself to thereturn bar(
line will break it.Running
coverage run --branch
and thencoverage lcov
on this test case will produce these branch coverage records:But line 5 is not in a function. We should instead get
which is what we do get if the close paren on line 4 is moved to line 3 (modulo #1873).
I presume that the code on lines 1-4 has confused the static analysis engine into thinking line 5 is inside a function, but then the arc description logic can't get a name for that function (because it doesn't exist).
The text was updated successfully, but these errors were encountered: