コード例 #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")])
コード例 #2
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")])
コード例 #3
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")])
コード例 #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")])
コード例 #5
0
ファイル: testcase.py プロジェクト: qixin/wiredtiger
 def run(self, result=None):
     if result is None:
         result = TestResult()
     result.startTest(self)
     result.addError(self, self._error)
     result.stopTest(self)
コード例 #6
0
ファイル: testcase.py プロジェクト: qixin/wiredtiger
 def run(self, result=None):
     if result is None:
         result = TestResult()
     result.startTest(self)
     result.addSuccess(self)
     result.stopTest(self)
コード例 #7
0
ファイル: testcase.py プロジェクト: bjornt/testtools
 def _result(self, result):
     if result is None:
         return TestResult()
     else:
         return ExtendedToOriginalDecorator(result)
コード例 #8
0
ファイル: testcase.py プロジェクト: bjornt/testtools
 def defaultTestResult(self):
     return TestResult()
コード例 #9
0
 def run(self, result=None):
     if result is None:
         result = TestResult()
     result.startTest(self)
     result.addError(self, self._error)
     result.stopTest(self)
コード例 #10
0
 def run(self, result=None):
     if result is None:
         result = TestResult()
     result.startTest(self)
     result.addSuccess(self)
     result.stopTest(self)