Skip to content

Commit 76e73c9

Browse files
committed
wtf?
1 parent 426e02d commit 76e73c9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

coverage/results.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ def missing_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]:
202202
branch_lines = set(self._branch_lines())
203203
mba = collections.defaultdict(list)
204204
for l1, l2 in missing:
205-
assert l1 != l2, f"missing_branch_arcs({self.filename!r}): ({l1}, {l2})"
205+
if l1 == l2:
206+
import contextlib, sys
207+
with open(f"/tmp/l1l2-{sys.version_info[1]}.out", "a") as f:
208+
with contextlib.redirect_stdout(f):
209+
print(f"missing_branch_arcs({self.filename!r}): ({l1}, {l2})")
206210
if l1 in branch_lines:
207211
mba[l1].append(l2)
208212
return mba
@@ -218,7 +222,12 @@ def executed_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]:
218222
branch_lines = set(self._branch_lines())
219223
eba = collections.defaultdict(list)
220224
for l1, l2 in self.arcs_executed:
221-
assert l1 != l2, f"executed_branch_arcs({self.filename!r}): ({l1}, {l2})"
225+
assert l1 != l2
226+
if l1 == l2:
227+
import contextlib, sys
228+
with open(f"/tmp/l1l2-{sys.version_info[1]}.out", "a") as f:
229+
with contextlib.redirect_stdout(f):
230+
print(f"executed_branch_arcs({self.filename!r}): ({l1}, {l2})")
222231
if (l1, l2) not in self.arc_possibilities_set:
223232
continue
224233
if l1 in branch_lines:

0 commit comments

Comments
 (0)