8000 test: add -q to our parser helper tool · shenanigansd/coveragepy@60a5d6f · GitHub
[go: up one dir, main page]

Skip to content

Commit 60a5d6f

Browse files
author
Ned Batchelder
committed
test: add -q to our parser helper tool
1 parent 7a627a6 commit 60a5d6f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lab/parser.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def main(self, args):
3333
"-R", action="store_true", dest="recursive",
3434
help="Recurse to find source files"
3535
)
36+
parser.add_option(
37+
"-q", action="store_true", dest="quiet",
38+
help="Suppress output"
39+
)
3640
parser.add_option(
3741
"-s", action="store_true", dest="source",
3842
help="Show analyzed source"
@@ -50,6 +54,8 @@ def main(self, args):
5054
root = "."
5155
for root, _, _ in os.walk(root):
5256
for f in glob.glob(root + "/*.py"):
57+
if not options.quiet:
58+
print(f"Parsing {f}")
5359
self.one_file(options, f)
5460
elif not args:
5561
parser.print_help()
@@ -121,7 +127,8 @@ def one_file(self, options, filename):
121127
else:
122128
a = ""
123129

124-
print("%4d %s%s %s" % (lineno, "".join(marks), a, ltext))
130+
if not options.quiet:
131+
print("%4d %s%s %s" % (lineno, "".join(marks), a, ltext))
125132

126133
def arc_ascii_art(self, arcs):
127134
"""Draw arcs as ascii art.

0 commit comments

Comments
 (0)
0