[Python-checkins] cpython: Issue #23145: regrtest now shows errors and raises an exception if

victor.stinner python-checkins at python.org
Tue Jan 6 14:10:24 CET 2015


https://hg.python.org/cpython/rev/1bb3df5bb83f
changeset:   94052:1bb3df5bb83f
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Jan 06 14:05:03 2015 +0100
summary:
  Issue #23145: regrtest now shows errors and raises an exception if
loader.loadTestsFromModule() logged errors.

files:
  Lib/test/regrtest.py |  4 ++++
  1 files changed, 4 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
@@ -1276,6 +1276,10 @@
                 def test_runner():
                     loader = unittest.TestLoader()
                     tests = loader.loadTestsFromModule(the_module)
+                    for error in loader.errors:
+                        print(error, file=sys.stderr)
+                    if loader.errors:
+                        raise Exception("errors while loading tests")
                     support.run_unittest(tests)
             test_runner()
             if huntrleaks:

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


More information about the Python-checkins mailing list