Flush stdout and stderr when running tests in parallel

(helps getting results in real-time when stdio is transmitted over a pipe or socket)
This commit is contained in:
Antoine Pitrou 2012-06-27 17:41:07 +02:00
parent d0bb9c6386
commit 8237258e09
1 changed files with 2 additions and 0 deletions

View File

@ -610,6 +610,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
print(stdout)
if stderr:
print(stderr, file=sys.stderr)
sys.stdout.flush()
sys.stderr.flush()
if result[0] == INTERRUPTED:
assert result[1] == 'KeyboardInterrupt'
raise KeyboardInterrupt # What else?