summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-06 13:05:03 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-06 13:05:03 (GMT)
commit5d575399bca935fec36d6a1ba538115406673415 (patch)
treea05c361bee94078e2c4f59e61abca3fe170e8d6e
parent4da9f32ac10867a0872feb312ae081cab225e471 (diff)
downloadcpython-5d575399bca935fec36d6a1ba538115406673415.zip
cpython-5d575399bca935fec36d6a1ba538115406673415.tar.gz
cpython-5d575399bca935fec36d6a1ba538115406673415.tar.bz2
Issue #23145: regrtest now shows errors and raises an exception if
loader.loadTestsFromModule() logged errors.
-rwxr-xr-xLib/test/regrtest.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index b633631..ea1287d 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1276,6 +1276,10 @@ def runtest_inner(test, verbose, quiet,
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: