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)
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)
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])
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])
def _red(cls, text): from quodlibet.util.dprint import Colorise return Colorise.red(text) if cls.use_colors else text
def addFailure(self, test, err): unittest.TestResult.addFailure(self, test, err) print_(Colorise.red(self.CHAR_FAILURE), end="")
def addError(self, test, err): unittest.TestResult.addError(self, test, err) print_(Colorise.red(self.CHAR_ERROR), end="")
def addFailure(self, test, err): unittest.TestResult.addFailure(self, test, err) print_(Colorise.red(self.CHAR_FAILURE), end="")
def addError(self, test, err): unittest.TestResult.addError(self, test, err) print_(Colorise.red(self.CHAR_ERROR), end="")
def _red(cls, text): from quodlibet.util.dprint import Colorise return Colorise.red(text) if cls.use_colors else text