From fe6822359eb0a2c202072ae40ca2b40c076ac9d5 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 13 May 2015 01:38:00 +0300 Subject: [PATCH] test.support: run_unittest(): Implement in terms on TestSuite and friends. --- test.support/test/support.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test.support/test/support.py b/test.support/test/support.py index ba4c81ba..c79663dc 100644 --- a/test.support/test/support.py +++ b/test.support/test/support.py @@ -4,8 +4,15 @@ import unittest TESTFN = '@test' def run_unittest(*classes): + suite = unittest.TestSuite() for c in classes: - unittest.run_class(c) + suite.addTest(c) + runner = unittest.TestRunner() + result = runner.run(suite) + msg = "Ran %d tests" % result.testsRun + if result.skippedNum > 0: + msg += " (%d skipped)" % result.skippedNum + print(msg) def can_symlink(): return False