[Python-checkins] cpython (merge 3.2 -> default): Always print out the traceback when a test "crashed"

antoine.pitrou python-checkins at python.org
Mon Mar 21 19:56:13 CET 2011


http://hg.python.org/cpython/rev/29ccd52f420a
changeset:   68815:29ccd52f420a
parent:      68813:b1582927dc54
parent:      68814:f51128a6dc24
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Mon Mar 21 19:55:58 2011 +0100
summary:
  Always print out the traceback when a test "crashed"

files:
  Lib/test/regrtest.py

diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1000,12 +1000,9 @@
         sys.stderr.flush()
         return FAILED, test_time
     except:
-        type, value = sys.exc_info()[:2]
-        print("test", test, "crashed --", str(type) + ":", value, file=sys.stderr)
+        msg = traceback.format_exc()
+        print("test", test, "crashed --", msg, file=sys.stderr)
         sys.stderr.flush()
-        if verbose or debug:
-            traceback.print_exc(file=sys.stderr)
-            sys.stderr.flush()
         return FAILED, test_time
     else:
         if refleak:

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


More information about the Python-checkins mailing list