|
38 | 38 | PYPY = platform.python_implementation() == "PyPy"
|
39 | 39 |
|
40 | 40 |
|
41 |
| -# $set_env.py: COVERAGE_IGOR_VERBOSE - More output from igor.py |
42 |
| -VERBOSITY = int(os.getenv("COVERAGE_IGOR_VERBOSE", "0")) |
| 41 | +# $set_env.py: COVERAGE_IGOR_VERBOSE - How much chatter from igor.py (default 1) |
| 42 | +VERBOSITY = int(os.getenv("COVERAGE_IGOR_VERBOSE", "1")) |
43 | 43 |
|
44 | 44 | # Functions named do_* are executable from the command line: do_blah is run
|
45 | 45 | # by "python igor.py blah".
|
@@ -87,16 +87,16 @@ def do_remove_extension(*args):
|
87 | 87 |
|
88 | 88 | for root, pattern in itertools.product(roots, so_patterns):
|
89 | 89 | pattern = os.path.join(root, pattern)
|
90 |
| - if VERBOSITY: |
| 90 | + if VERBOSITY > 1: |
91 | 91 | print(f"Searching for {pattern} from {os.getcwd()}")
|
92 | 92 | for filename in glob.glob(pattern):
|
93 | 93 | if os.path.exists(filename):
|
94 |
| - if VERBOSITY: |
| 94 | + if VERBOSITY > 1: |
95 | 95 | print(f"Removing {os.path.abspath(filename)}")
|
96 | 96 | try:
|
97 | 97 | os.remove(filename)
|
98 | 98 | except OSError as exc:
|
99 |
| - if VERBOSITY: |
| 99 | + if VERBOSITY > 1: |
100 | 100 | print(f"Couldn't remove {os.path.abspath(filename)}: {exc}")
|
101 | 101 |
|
102 | 102 |
|
@@ -140,13 +140,9 @@ def should_skip(core):
|
140 | 140 | skipper = f"No C core for {platform.python_implementation()}"
|
141 | 141 |
|
142 | 142 | if skipper:
|
143 |
| - msg = "Skipping tests " + label_for_core(core) |
144 |
| - if len(skipper) > 1: |
145 |
| - msg += ": " + skipper |
| 143 | + return f"Skipping tests {label_for_core(core)}: {skipper}" |
146 | 144 | else:
|
147 |
| - msg = "" |
148 |
| - |
149 |
| - return msg |
| 145 | + return "" |
150 | 146 |
|
151 | 147 |
|
152 | 148 | def make_env_id(core):
|
@@ -253,7 +249,8 @@ def do_test_with_core(core, *runner_args):
|
253 | 249 | # If we should skip these tests, skip them.
|
254 | 250 | skip_msg = should_skip(core)
|
255 | 251 | if skip_msg:
|
256 |
| - print(skip_msg) |
| 252 | + if VERBOSITY > 0: |
| 253 | + print(skip_msg) |
257 | 254 | return None
|
258 | 255 |
|
259 | 256 | os.environ["COVERAGE_CORE"] = core
|
|
0 commit comments