[elbe-devel] [PATCH 4/5] commands: test: More verbosity

Olivier Dion dion at linutronix.de
Thu Jul 23 04:51:18 CEST 2020


Also fix key=str for sorting.  Thanks to pylint.

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/commands/test.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/elbepack/commands/test.py b/elbepack/commands/test.py
index be493a99..a1a5af59 100644
--- a/elbepack/commands/test.py
+++ b/elbepack/commands/test.py
@@ -80,7 +80,7 @@ class ElbeTestSuite(object):
 
         rc = re.compile(regex, re.IGNORECASE)
 
-        self.tests.sort(key=lambda x: str(x))
+        self.tests.sort(key=str)
 
         # Tests filtered here are skipped quietly
         i = 0
@@ -156,12 +156,11 @@ def run_command(argv):
     # then filter them
     suite.filter_test(opt.parallel, opt.filter, opt.invert_re)
 
-    # print them
-    suite.ls()
-
     # Dry run? Just exit gently
     if opt.dry_run:
-        print("This was a dry run. No tests were executed")
+        suite.ls()
+        print("======================================================================\n"
+              "This was a dry run. No tests were executed")
         os.sys.exit(0)
 
     cases = []
@@ -171,6 +170,8 @@ def run_command(argv):
 
     for test in suite:
 
+        print(test)
+
         result = unittest.TestResult()
 
         test.run(result)
@@ -185,6 +186,10 @@ def run_command(argv):
             case.add_failure_info(message=failure[1])
             fail_cnt += 1
 
+        for us in result.unexpectedSuccesses:
+            case.add_failure_info(message=us[1])
+            err_cnt += 1
+
         for skip in result.skipped:
             case.add_skipped_info(message=skip[1])
 
-- 
2.27.0



More information about the elbe-devel mailing list