Skip to content

Commit

Permalink
wtf?
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Nov 8, 2024
1 parent 426e02d commit 76e73c9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions coverage/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ def missing_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]:
branch_lines = set(self._branch_lines())
mba = collections.defaultdict(list)
for l1, l2 in missing:
assert l1 != l2, f"missing_branch_arcs({self.filename!r}): ({l1}, {l2})"
if l1 == l2:
import contextlib, sys
with open(f"/tmp/l1l2-{sys.version_info[1]}.out", "a") as f:
with contextlib.redirect_stdout(f):
print(f"missing_branch_arcs({self.filename!r}): ({l1}, {l2})")
if l1 in branch_lines:
mba[l1].append(l2)
return mba
Expand All @@ -218,7 +222,12 @@ def executed_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]:
branch_lines = set(self._branch_lines())
eba = collections.defaultdict(list)
for l1, l2 in self.arcs_executed:
assert l1 != l2, f"executed_branch_arcs({self.filename!r}): ({l1}, {l2})"
assert l1 != l2
if l1 == l2:
import contextlib, sys
with open(f"/tmp/l1l2-{sys.version_info[1]}.out", "a") as f:
with contextlib.redirect_stdout(f):
print(f"executed_branch_arcs({self.filename!r}): ({l1}, {l2})")
if (l1, l2) not in self.arc_possibilities_set:
continue
if l1 in branch_lines:
Expand Down

0 comments on commit 76e73c9

Please sign in to comment.