Ejemplo n.º 1
0
 def printErrors(self):
     succ = self.testsRun - (len(self.errors) + len(self.failures))
     v = Colorise.bold("%3d" % succ)
     cv = Colorise.green(v) if succ == self.testsRun else Colorise.red(v)
     count = self.TEST_RESULTS_WIDTH - self.testsRun
     print_((" " * count) + cv)
     self.printErrorList('ERROR', self.errors)
     self.printErrorList('FAIL', self.failures)
Ejemplo n.º 2
0
 def printErrors(self):
     succ = self.testsRun - (len(self.errors) + len(self.failures))
     v = Colorise.bold("%3d" % succ)
     cv = Colorise.green(v) if succ == self.testsRun else Colorise.red(v)
     count = self.TEST_RESULTS_WIDTH - self.testsRun
     print_((" " * count) + cv)
     self.printErrorList('ERROR', self.errors)
     self.printErrorList('FAIL', self.failures)
Ejemplo n.º 3
0
 def printErrorList(self, flavour, errors):
     for test, err in errors:
         print_(self.MAJOR_SEPARATOR)
         print_(Colorise.red("%s: %s" % (flavour, str(test))))
         print_(self.MINOR_SEPARATOR)
         # tracebacks can contain encoded paths, not sure
         # what the right fix is here, so use repr
         for line in err.splitlines():
             print_(repr(line)[1:-1])
Ejemplo n.º 4
0
 def printErrorList(self, flavour, errors):
     for test, err in errors:
         print_(self.MAJOR_SEPARATOR)
         print_(Colorise.red("%s: %s" % (flavour, str(test))))
         print_(self.MINOR_SEPARATOR)
         # tracebacks can contain encoded paths, not sure
         # what the right fix is here, so use repr
         for line in err.splitlines():
             print_(repr(line)[1:-1])
Ejemplo n.º 5
0
 def _red(cls, text):
     from quodlibet.util.dprint import Colorise
     return Colorise.red(text) if cls.use_colors else text
Ejemplo n.º 6
0
 def addFailure(self, test, err):
     unittest.TestResult.addFailure(self, test, err)
     print_(Colorise.red(self.CHAR_FAILURE), end="")
Ejemplo n.º 7
0
 def addError(self, test, err):
     unittest.TestResult.addError(self, test, err)
     print_(Colorise.red(self.CHAR_ERROR), end="")
Ejemplo n.º 8
0
 def addFailure(self, test, err):
     unittest.TestResult.addFailure(self, test, err)
     print_(Colorise.red(self.CHAR_FAILURE), end="")
Ejemplo n.º 9
0
 def addError(self, test, err):
     unittest.TestResult.addError(self, test, err)
     print_(Colorise.red(self.CHAR_ERROR), end="")
Ejemplo n.º 10
0
 def _red(cls, text):
     from quodlibet.util.dprint import Colorise
     return Colorise.red(text) if cls.use_colors else text