MCPcopy Index your code
hub / github.com/python/cpython / addSubTest

Method addSubTest

Lib/unittest/result.py:126–141  ·  view source on GitHub ↗

Called at the end of a subtest. 'err' is None if the subtest ended successfully, otherwise it's a tuple of values as returned by sys.exc_info().

(self, test, subtest, err)

Source from the content-addressed store, hash-verified

124 self._mirrorOutput = True
125
126 def addSubTest(self, test, subtest, err):
127 """Called at the end of a subtest.
128 'err' is None if the subtest ended successfully, otherwise it's a
129 tuple of values as returned by sys.exc_info().
130 """
131 # By default, we don't do anything with successful subtests, but
132 # more sophisticated test results might want to record them.
133 if err is not None:
134 if getattr(self, 'failfast', False):
135 self.stop()
136 if issubclass(err[0], test.failureException):
137 errors = self.failures
138 else:
139 errors = self.errors
140 errors.append((subtest, self._exc_info_to_string(err, test)))
141 self._mirrorOutput = True
142
143 def addSuccess(self, test):
144 "Called when a test has completed successfully"

Callers 4

report_successMethod · 0.45
report_failureMethod · 0.45
testPartExecutorMethod · 0.45

Calls 3

stopMethod · 0.95
_exc_info_to_stringMethod · 0.95
appendMethod · 0.45

Tested by 3

report_successMethod · 0.36
report_failureMethod · 0.36