Skip to content

Commit efc9ca2

Browse files
committed
fix: executed_branch_arcs should limit itself to parsed possible arcs
1 parent 9063f0c commit efc9ca2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coverage/results.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ def missing_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]:
211211
def executed_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]:
212212
"""Return arcs that were executed from branch lines.
213213
214+
Only include ones that we considered possible.
215+
214216
Returns {l1:[l2a,l2b,...], ...}
215217
216218
"""
@@ -219,6 +221,8 @@ def executed_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]:
219221
for l1, l2 in self.arcs_executed:
220222
if l1 == l2:
221223
continue
224+
if (l1, l2) not in self.arc_possibilities_set:
225+
continue
222226
if l1 in branch_lines:
223227
eba[l1].append(l2)
224228
return eba

0 commit comments

Comments
 (0)