]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Flush stdout and stderr when running tests in parallel
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 27 Jun 2012 15:41:07 +0000 (17:41 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 27 Jun 2012 15:41:07 +0000 (17:41 +0200)
(helps getting results in real-time when stdio is transmitted over a pipe or socket)

Lib/test/regrtest.py

index 714a116f87d5d13bc613c7cbe9280742960860ee..46c3ac79dfafed5e19af9c74362389f43b0cfcea 100755 (executable)
@@ -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?