MCPcopy
hub / github.com/pytest-dev/pytest / _getreprcrash

Method _getreprcrash

src/_pytest/_code/code.py:690–699  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

688 return isinstance(self.value, exc)
689
690 def _getreprcrash(self) -> ReprFileLocation | None:
691 # Find last non-hidden traceback entry that led to the exception of the
692 # traceback, or None if all hidden.
693 for i in range(-1, -len(self.traceback) - 1, -1):
694 entry = self.traceback[i]
695 if not entry.ishidden(self):
696 path, lineno = entry.frame.code.raw.co_filename, entry.lineno
697 exconly = self.exconly(tryshort=True)
698 return ReprFileLocation(path, lineno + 1, exconly)
699 return None
700
701 def getrepr(
702 self,

Callers 7

getreprMethod · 0.95
from_item_and_callMethod · 0.80
assertrepr_compareFunction · 0.80
repr_excinfoMethod · 0.80
test_getreprcrashMethod · 0.80

Calls 3

exconlyMethod · 0.95
ReprFileLocationClass · 0.85
ishiddenMethod · 0.80

Tested by 2

test_getreprcrashMethod · 0.64