[Python-checkins] cpython (2.7): Flush stdout and stderr when running tests in parallel

antoine.pitrou python-checkins at python.org
Wed Jun 27 17:44:55 CEST 2012


http://hg.python.org/cpython/rev/78e7d2d4b26d
changeset:   77821:78e7d2d4b26d
branch:      2.7
parent:      77818:727ff6e2d3a4
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Jun 27 17:41:07 2012 +0200
summary:
  Flush stdout and stderr when running tests in parallel
(helps getting results in real-time when stdio is transmitted over a pipe or socket)

files:
  Lib/test/regrtest.py |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -540,6 +540,8 @@
                     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?

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list