1. pygame
  2. Untitled project
  3. pygame

Commits

akalias  committed 413424b

Fixed bug in run_tests_sub.py, crashed when running xxxx_test.py with no tests

  • Participants
  • Parent commits 7ae2662
  • Branches default

Comments (0)

Files changed (1)

File run_tests_sub.py

View file
 t = time.time() - t
 
 ################################################################################
-
 # Output results
 
 all_dots = ''
         complete_failures += 1
         continue
 
-    dots = DOTS.search(ret).group(1)
+    dots = DOTS.search(ret)
+    if not dots: continue                   # in case of empty xxxx_test.py
+    else: dots = dots.group(1)
+
     all_dots += dots
 
     if 'E' in dots or 'F' in dots:
 if not failures:
     print 'OK'
 else:
-    print ( 'FAILED (failures=%s, errors=%s, complete_failures=%s)' % 
-                 (total_fails, total_errors, complete_failures) )
+    print 'FAILED (%s)' % ', '.join (
+        total_fails  and ["failures=%s" % total_fails] or [] +
+        total_errors and ["errors=%s"  % total_errors] or [] + 
+        complete_failures and ["complete_failures=%s" % complete_failures] or []
+    )
     
 ################################################################################