Skip to content

Commit 0a2c76d

Browse files
committed
refactor(tools): stream unittest output live in run-unit-tests
Stop capturing subprocess stdout/stderr so each plugin's unittest dots, failure tracebacks and summary ("OK" / "FAILED") are printed live, matching the output of running `./run` by hand. Subprocess stderr is redirected to stdout so the terminal does not color the output red.
1 parent 5967685 commit 0a2c76d

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

tools/run-unit-tests

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,26 +179,17 @@ def main():
179179

180180
for i, plugin in enumerate(plugins, 1):
181181
unit_test_dir = os.path.join(check_plugins, plugin, 'unit-test')
182-
print(f'[{i}/{total}] {plugin} ... ', end='', flush=True)
182+
print(f'[{i}/{total}] {plugin}', flush=True)
183183

184184
result = subprocess.run(
185185
[sys.executable, 'run'],
186186
cwd=unit_test_dir,
187-
capture_output=True,
188-
text=True,
187+
stderr=subprocess.STDOUT,
189188
)
190189
if result.returncode == 0:
191190
passed.append(plugin)
192-
print('ok')
193191
else:
194192
failed.append(plugin)
195-
print('FAIL')
196-
if result.stdout:
197-
for line in result.stdout.strip().splitlines():
198-
print(f' {line}')
199-
if result.stderr:
200-
for line in result.stderr.strip().splitlines():
201-
print(f' {line}')
202193

203194
# summary
204195
print(f'\n{len(passed)} passed, {len(failed)} failed out of {total}')

0 commit comments

Comments
 (0)