@@ -94,7 +94,7 @@ class UnitTest(WarningCountingShellCommand):
9494 command = ["python" , "-m" , "unittest" , "discover" ]
9595
9696 regexPatterns = {
97- "total " : "Ran (\d+) tests in [0-9.]+s" ,
97+ "tests " : "Ran (\d+) tests in [0-9.]+s" ,
9898 "time" : "Ran \d+ tests in ([0-9.]+)s" ,
9999 "skipped" : "(?:OK|FAILED).*\skipped=(\d+)" ,
100100 "failed" : "FAILED.*failures\=(\d+)" ,
@@ -138,10 +138,15 @@ class UnitTest(WarningCountingShellCommand):
138138 description = WarningCountingShellCommand .describe (self , done )
139139 if done :
140140 description = description [:] # make a private copy
141- for name in ["time" , "total" , "skipped" , "failed" , "errors" , "template_coverage" , "url_coverage" , "code_coverage" , ]:
141+ self .step_status .statistics ["passed" ] = (
142+ self .step_status .getStatistic ("tests" ,0 ) -
143+ self .step_status .getStatistic ("skipped" ,0 ) -
144+ self .step_status .getStatistic ("failed" ,0 ) -
145+ self .step_status .getStatistic ("errors" ,0 ))
146+ for name in ["time" , "tests" , "passed" , "skipped" , "failed" , "errors" , "template_coverage" , "url_coverage" , "code_coverage" , ]:
142147 if name in self .step_status .statistics :
143148 value = self .step_status .getStatistic (name )
144- displayName = name .replace ('_' , ' ' ). capitalize ()
149+ displayName = name .replace ('_' , ' ' )
145150 if type (value ) is float : # this is run-time
146151 description .append ('%s: %.2fs' % (displayName , value ))
147152 elif type (value ) is int :
0 commit comments