(self, test, example)
| 1319 | 'Exception raised:\n' + _indent(_exception_traceback(exc_info))) |
| 1320 | |
| 1321 | def _failure_header(self, test, example): |
| 1322 | red, reset = ( |
| 1323 | (ANSIColors.RED, ANSIColors.RESET) if can_colorize() else ("", "") |
| 1324 | ) |
| 1325 | out = [f"{red}{self.DIVIDER}{reset}"] |
| 1326 | if test.filename: |
| 1327 | if test.lineno is not None and example.lineno is not None: |
| 1328 | lineno = test.lineno + example.lineno + 1 |
| 1329 | else: |
| 1330 | lineno = '?' |
| 1331 | out.append('File "%s", line %s, in %s' % |
| 1332 | (test.filename, lineno, test.name)) |
| 1333 | else: |
| 1334 | out.append('Line %s, in %s' % (example.lineno+1, test.name)) |
| 1335 | out.append('Failed example:') |
| 1336 | source = example.source |
| 1337 | out.append(_indent(source)) |
| 1338 | return '\n'.join(out) |
| 1339 | |
| 1340 | #///////////////////////////////////////////////////////////////// |
| 1341 | # DocTest Running |
no test coverage detected