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

Method _add_traceback

Lib/doctest.py:2339–2355  ·  view source on GitHub ↗
(self, traceback, test, example)

Source from the content-addressed store, hash-verified

2337 self._test_result.addSubTest(self._test_case, self._subTest(), exc_info)
2338
2339 def _add_traceback(self, traceback, test, example):
2340 if test.lineno is None or example.lineno is None:
2341 lineno = None
2342 else:
2343 lineno = test.lineno + example.lineno + 1
2344 return types.SimpleNamespace(
2345 tb_frame = types.SimpleNamespace(
2346 f_globals=test.globs,
2347 f_code=types.SimpleNamespace(
2348 co_filename=test.filename,
2349 co_name=test.name,
2350 ),
2351 ),
2352 tb_next = traceback,
2353 tb_lasti = -1,
2354 tb_lineno = lineno,
2355 )
2356
2357
2358class DocTestCase(unittest.TestCase):

Callers 2

report_failureMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected