[Python-checkins] cpython (merge 3.2 -> default): Flush stdout and stderr when running tests in parallel

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


http://hg.python.org/cpython/rev/6459619aea40
changeset:   77820:6459619aea40
parent:      77817:ebd8ac0db443
parent:      77819:d07319eeae87
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Jun 27 17:41:33 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
@@ -677,6 +677,8 @@
                     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?

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


More information about the Python-checkins mailing list