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:33 +02:00
commit 67a7b06008
1 changed files with 2 additions and 0 deletions

View File

@ -677,6 +677,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?