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 3a121561b7
commit cf807c04a3
1 changed files with 2 additions and 0 deletions

View File

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