Example #1
0
 def __init__(self, err, test):
     """Create a TracebackContent for err."""
     if err is None:
         raise ValueError("err may not be None")
     content_type = ContentType('text', 'x-traceback',
         {"language": "python", "charset": "utf8"})
     self._result = TestResult()
     value = self._result._exc_info_to_unicode(err, test)
     super(TracebackContent, self).__init__(
         content_type, lambda: [value.encode("utf8")])
 def __init__(self, err, test):
     """Create a TracebackContent for err."""
     if err is None:
         raise ValueError("err may not be None")
     content_type = ContentType('text', 'x-traceback',
         {"language": "python", "charset": "utf8"})
     self._result = TestResult()
     value = self._result._exc_info_to_unicode(err, test)
     super(TracebackContent, self).__init__(
         content_type, lambda: [value.encode("utf8")])
class TracebackContent(Content):
    """Content object for tracebacks.

    This adapts an exc_info tuple to the Content interface.
    text/x-traceback;language=python is used for the mime type, in order to
    provide room for other languages to format their tracebacks differently.
    """

    def __init__(self, err, test):
        """Create a TracebackContent for err."""
        if err is None:
            raise ValueError("err may not be None")
        content_type = ContentType('text', 'x-traceback',
            {"language": "python", "charset": "utf8"})
        self._result = TestResult()
        value = self._result._exc_info_to_unicode(err, test)
        super(TracebackContent, self).__init__(
            content_type, lambda: [value.encode("utf8")])
Example #4
0
class TracebackContent(Content):
    """Content object for tracebacks.

    This adapts an exc_info tuple to the Content interface.
    text/x-traceback;language=python is used for the mime type, in order to
    provide room for other languages to format their tracebacks differently.
    """

    def __init__(self, err, test):
        """Create a TracebackContent for err."""
        if err is None:
            raise ValueError("err may not be None")
        content_type = ContentType('text', 'x-traceback',
            {"language": "python", "charset": "utf8"})
        self._result = TestResult()
        value = self._result._exc_info_to_unicode(err, test)
        super(TracebackContent, self).__init__(
            content_type, lambda: [value.encode("utf8")])
Example #5
0
 def run(self, result=None):
     if result is None:
         result = TestResult()
     result.startTest(self)
     result.addError(self, self._error)
     result.stopTest(self)
Example #6
0
 def run(self, result=None):
     if result is None:
         result = TestResult()
     result.startTest(self)
     result.addSuccess(self)
     result.stopTest(self)
Example #7
0
 def _result(self, result):
     if result is None:
         return TestResult()
     else:
         return ExtendedToOriginalDecorator(result)
Example #8
0
 def defaultTestResult(self):
     return TestResult()
Example #9
0
 def run(self, result=None):
     if result is None:
         result = TestResult()
     result.startTest(self)
     result.addError(self, self._error)
     result.stopTest(self)
Example #10
0
 def run(self, result=None):
     if result is None:
         result = TestResult()
     result.startTest(self)
     result.addSuccess(self)
     result.stopTest(self)