def addExpectedFailure(self, test, err): super(TAPTestResult, self).addExpectedFailure(test, err) diagnostics = formatter.format_exception(err) self.tracker.add_not_ok(self._cls_name(test), self._description(test), _('(expected failure)'), diagnostics=diagnostics)
def addError(self, test, err): err_cls, reason, _ = err if err_cls != SkipTest: diagnostics = formatter.format_exception(err) self.tracker.add_not_ok( self._cls_name(test), self._description(test), diagnostics=diagnostics) else: self.tracker.add_skip( self._cls_name(test), self._description(test), reason)
def addSubTest(self, test, subtest, err): super(TAPTestResult, self).addSubTest(test, subtest, err) if err is not None: diagnostics = formatter.format_exception(err) self.tracker.add_not_ok(self._cls_name(test), self._description(subtest), diagnostics=diagnostics) else: self.tracker.add_ok(self._cls_name(test), self._description(subtest))
def addFailure(self, test, err): diagnostics = formatter.format_exception(err) self.tracker.add_not_ok( self._cls_name(test), self._description(test), diagnostics=diagnostics)
def test_format_exception_as_diagnostics(self): exc = self.factory.make_exc() diagnostics = format_exception(exc) self.assertTrue(diagnostics.startswith('# ')) self.assertTrue('boom' in diagnostics)
def addError(self, test, err): super(TAPTestResult, self).addError(test, err) diagnostics = formatter.format_exception(err) self.tracker.add_not_ok(self._cls_name(test), self._description(test), diagnostics=diagnostics)
def addExpectedFailure(self, test, err): super(TAPTestResult, self).addExpectedFailure(test, err) diagnostics = formatter.format_exception(err) self.tracker.add_not_ok( self._cls_name(test), self._description(test), _('(expected failure)'), diagnostics=diagnostics)
def addError(self, test, err): super(TAPTestResult, self).addError(test, err) diagnostics = formatter.format_exception(err) self.tracker.add_not_ok( self._cls_name(test), self._description(test), diagnostics=diagnostics)