]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#7110: have regrtest print test failures and tracebacks to stderr not stdout.
authorR. David Murray <rdmurray@bitdance.com>
Wed, 29 Sep 2010 01:08:05 +0000 (01:08 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Wed, 29 Sep 2010 01:08:05 +0000 (01:08 +0000)
Patch by Sandro Tosi.

Lib/test/regrtest.py
Misc/ACKS
Misc/NEWS

index 366cedfda187fdcea5b2bc9a04fc39deb2167482..55c73e23ce13797b4fc592a46ea48089c5b662f7 100755 (executable)
@@ -957,16 +957,16 @@ def runtest_inner(test, verbose, quiet,
     except KeyboardInterrupt:
         raise
     except support.TestFailed as msg:
-        print("test", test, "failed --", msg)
-        sys.stdout.flush()
+        print("test", test, "failed --", msg, file=sys.stderr)
+        sys.stderr.flush()
         return FAILED, test_time
     except:
         type, value = sys.exc_info()[:2]
-        print("test", test, "crashed --", str(type) + ":", value)
-        sys.stdout.flush()
+        print("test", test, "crashed --", str(type) + ":", value, file=sys.stderr)
+        sys.stderr.flush()
         if verbose or debug:
-            traceback.print_exc(file=sys.stdout)
-            sys.stdout.flush()
+            traceback.print_exc(file=sys.stderr)
+            sys.stderr.flush()
         return FAILED, test_time
     else:
         if refleak:
index 5d12c1f6c7a1f5dda5a815c080dc8a88566cfbe4..228dfe7f4127c3dad130e5bda571a6abc7f78951 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -818,6 +818,7 @@ Frank J. Tobin
 R Lindsay Todd
 Bennett Todd
 Matias Torchinsky
+Sandro Tosi
 Richard Townsend
 Laurence Tratt
 John Tromp
index 34fd5121ea9d4c59952ee5880194b754d51c23b6..03ca4a5c605f83499310d361298f4c661d77d454 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -260,6 +260,9 @@ Tools/Demos
 Tests
 -----
 
+- Issue #7110: regrtest now sends test failure reports and single-failure
+  tracebacks to stderr rather than stdout.
+
 - Issue #9628: fix runtests.sh -x option so more than one test can be excluded.
 
 - Issue #9899: Fix test_tkinter.test_font on various platforms.  Patch by