Explorar el Código

Feedback for every testcase to console added

master
Dirk Alders hace 3 años
padre
commit
68fe7bdcf7
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4
    0
      __init__.py

+ 4
- 0
__init__.py Ver fichero

@@ -318,6 +318,7 @@ class testSession(dict):
318 318
 
319 319
     def testCase(self, name, testcase_execution_level, test_method, *args, **kwargs):
320 320
         if testcase_execution_level <= self[self.KEY_EXEC_LVL]:
321
+            sys.stdout.write('     %s...' % name[:75])
321 322
             tLogger = logging.getLogger('__tLogger__')
322 323
             tHandler = collectingTestcaseHandler()
323 324
             if len(tHandler.MY_LOGS) > 0:
@@ -362,10 +363,13 @@ class testSession(dict):
362 363
             self[self.KEY_ALL_TESTS] += 1
363 364
             if self[self.KEY_TESTCASELIST][name]['levelno'] <= logging.INFO:
364 365
                 self[self.KEY_SUCCESS_TESTS] += 1
366
+                sys.stdout.write('\033[92mSUCCESS\033[0m\n')
365 367
             elif self[self.KEY_TESTCASELIST][name]['levelno'] >= logging.ERROR:
366 368
                 self[self.KEY_FAILED_TESTS] += 1
369
+                sys.stdout.write('\033[91mFAILED\033[0m\n')
367 370
             else:
368 371
                 self[self.KEY_POSSIBLY_FAILED_TESTS] += 1
372
+                sys.stdout.write('\033[93mPOSSIBLY FAILED\033[0m\n')
369 373
             # Set testcase time and time_consumption
370 374
             self[self.KEY_TESTCASELIST][name]['time_start'] = self.__testcase__['asctime']
371 375
             self[self.KEY_TESTCASELIST][name]['time_finished'] = teststep['asctime']

Loading…
Cancelar
Guardar