MCPcopy Index your code
hub / github.com/RustPython/RustPython / format_failure

Method format_failure

Lib/doctest.py:2334–2344  ·  view source on GitHub ↗
(self, err)

Source from the content-addressed store, hash-verified

2332 raise self.failureException(self.format_failure(new.getvalue().rstrip('\n')))
2333
2334 def format_failure(self, err):
2335 test = self._dt_test
2336 if test.lineno is None:
2337 lineno = 'unknown line number'
2338 else:
2339 lineno = '%s' % test.lineno
2340 lname = '.'.join(test.name.split('.')[-1:])
2341 return ('Failed doctest test for %s\n'
2342 ' File "%s", line %s, in %s\n\n%s'
2343 % (test.name, test.filename, lineno, lname, err)
2344 )
2345
2346 def debug(self):
2347 r"""Run the test case without results and without catching exceptions

Callers 1

runTestMethod · 0.95

Calls 2

joinMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected