From 77ee8f2355fc2613143b0b1dd49325cdd3ad1ca6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 25 Sep 2024 16:56:06 -0400 Subject: [PATCH] fix: executed_branch_arcs should limit itself to parsed possible arcs --- coverage/results.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coverage/results.py b/coverage/results.py index 0bcc317bd..7191dcd1a 100644 --- a/coverage/results.py +++ b/coverage/results.py @@ -211,6 +211,8 @@ def missing_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]: def executed_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]: """Return arcs that were executed from branch lines. + Only include ones that we considered possible. + Returns {l1:[l2a,l2b,...], ...} """ @@ -219,6 +221,8 @@ def executed_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]: for l1, l2 in self.arcs_executed: if l1 == l2: continue + if (l1, l2) not in self.arc_possibilities_set: + continue if l1 in branch_lines: eba[l1].append(l2) return eba