You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When this simple Python script is analyzed for branch coverage...
#! /usr/bin/python3
print("Executed unconditionally")
if __name__ == "__main__":
print("Executed if __name__ == __main__")
... both the HTML and LCOV reporters describe the non-executed branch that skips over print("Executed if __name__ == __main__") with an extra "didn't."
top-level-if-1.lcov
SF:top-level-if-1.py
DA:3,1
DA:5,1
DA:6,1
LF:3
LH:3
BRDA:5,0,jump to line 6,1
BRDA:5,0,didn't exit the module,0
BRF:2
BRH:1
end_of_record
Describe the bug
When this simple Python script is analyzed for branch coverage...
... both the HTML and LCOV reporters describe the non-executed branch that skips over
print("Executed if __name__ == __main__")
with an extra "didn't."top-level-if-1.lcov
top-level-if-1_py.html
excerptThe problem is with the second BRDA: line in the lcov output:
BRDA:5,0,
didn'texit the module,0and with the long annotation for line 5 in the html output:
<span class="annotate long">line 5
didn'tdidn't exit the module because the condition on line 5 was always true</span>Strikethroughindicates text that should be removed.I imagine this is fallout from the refactoring done to address #1850.
To Reproduce
top-level-if-1.py
.coverage run --branch top-level-if-1.py
.coverage lcov -o top-level-if-1.lcov
should produce an identical file totop-level-if-1.lcov
embedded above.coverage html
should produce (among other things)top-level-if-1_py.html
matching the excerpt embedded above.The text was updated successfully, but these errors were encountered: