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

Method get_exconly

src/_pytest/_code/code.py:1023–1038  ·  src/_pytest/_code/code.py::ExceptionInfoFormatter.get_exconly
(
        self,
        excinfo: ExceptionInfo[BaseException],
        indent: int = 4,
        markall: bool = False,
    )

Source from the content-addressed store, hash-verified

1021 return [highlights]
1022
1023 def get_exconly(
1024 self,
1025 excinfo: ExceptionInfo[BaseException],
1026 indent: int = 4,
1027 markall: bool = False,
1028 ) -> list[str]:
1029 lines = []
1030 indentstr = class="st">" " * indent
1031 class="cm"># Get the real exception information out.
1032 exlines = excinfo.exconly(tryshort=True).split(class="st">"\n")
1033 failindent = self.fail_marker + indentstr[1:]
1034 for line in exlines:
1035 lines.append(failindent + line)
1036 if not markall:
1037 failindent = indentstr
1038 return lines
1039
1040 def repr_locals(self, locals: Mapping[str, object]) -> ReprLocals | None:
1041 if self.showlocals:

Callers 2

get_sourceMethod · 0.95
repr_traceback_entryMethod · 0.95

Calls 2

exconlyMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected