Skip to content

Commit 375b4ae

Browse files
committed
debug: tweaks to make these clearer
1 parent ac8c29a commit 375b4ae

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

coverage/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ def __init__(self, text, statements, multiline):
644644
self.missing_arc_fragments = collections.defaultdict(list)
645645
self.block_stack = []
646646

647-
# $set_env.py: COVERAGE_TRACK_ARCS - Trace every arc added while parsing code.
647+
# $set_env.py: COVERAGE_TRACK_ARCS - Trace possible arcs added while parsing code.
648648
self.debug = bool(int(os.environ.get("COVERAGE_TRACK_ARCS", 0)))
649649

650650
def analyze(self):
@@ -664,8 +664,8 @@ def analyze(self):
664664
def add_arc(self, start, end, smsg=None, emsg=None):
665665
"""Add an arc, including message fragments to use if it is missing."""
666666
if self.debug: # pragma: debugging
667-
print(f"\nAdding arc: ({start}, {end}): {smsg!r}, {emsg!r}")
668-
print(short_stack(limit=6))
667+
print(f"\nAdding possible arc: ({start}, {end}): {smsg!r}, {emsg!r}")
668+
print(short_stack(limit=10))
669669
self.arcs.add((start, end))
670670

671671
if smsg is not None or emsg is not None:

coverage/pytracer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ def log(self, marker, *args):
8282
id(self),
8383
len(self.data_stack),
8484
))
85-
if 0:
85+
if 0: # if you want thread ids..
8686
f.write(".{:x}.{:x}".format(
8787
self.thread.ident,
8888
self.threading.current_thread().ident,
8989
))
9090
f.write(" {}".format(" ".join(map(str, args))))
91-
if 0:
91+
if 0: # if you want callers..
9292
f.write(" | ")
9393
stack = " / ".join(
9494
(fname or "???").rpartition("/")[-1]
@@ -136,8 +136,7 @@ def _trace(self, frame, event, arg_unused):
136136
else:
137137
self.started_context = False
138138

139-
# Entering a new frame. Decide if we should trace
140-
# in this file.
139+
# Entering a new frame. Decide if we should trace in this file.
141140
self._activity = True
142141
self.data_stack.append(
143142
(

0 commit comments

Comments
 (0)