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)
| 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" |