test_driver: flush output after each test

When the output is redirected, Python buffer its whole output, unlike
a TTY output where only lines are buffered.
In GitHub actions in particular, it means that we can't see any progress
after each test. And if a test blocks forever, there is no output at all.

So flush the output after printing each result to see the progress
being made
This commit is contained in:
Nahor
2025-12-18 11:25:49 -08:00
committed by Johannes Altmanninger
parent 7b8f97c1ff
commit 81fce66269

View File

@@ -184,7 +184,8 @@ async def main():
)
suffix_str = "" if suffix is None else f"\n{suffix}"
print(
f"{arg.ljust(longest_test_name_length)} {color}{result}{RESET} {duration_str}{suffix_str}"
f"{arg.ljust(longest_test_name_length)} {color}{result}{RESET} {duration_str}{suffix_str}",
flush=True,
)
with tempfile.TemporaryDirectory(prefix="fishtest-root-") as tmp_root: