MCPcopy Create free account
hub / github.com/pytest-dev/pytest / ReprFileLocation

Class ReprFileLocation

src/_pytest/_code/code.py:1154–1167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1152
1153@attr.s(eq=False, auto_attribs=True)
1154class ReprFileLocation(TerminalRepr):
1155 path: str = attr.ib(converter=str)
1156 lineno: int
1157 message: str
1158
1159 def toterminal(self, tw: TerminalWriter) -> None:
1160 # Filename and lineno output for each entry, using an output format
1161 # that most editors understand.
1162 msg = self.message
1163 i = msg.find("\n")
1164 if i != -1:
1165 msg = msg[:i]
1166 tw.write(self.path, bold=True, red=True)
1167 tw.line(f":{self.lineno}: {msg}")
1168
1169
1170@attr.s(eq=False, auto_attribs=True)

Callers 5

repr_failureMethod · 0.90
deserialize_repr_entryFunction · 0.90
deserialize_repr_crashFunction · 0.90
_getreprcrashMethod · 0.85
repr_traceback_entryMethod · 0.85

Calls

no outgoing calls

Tested by 1

repr_failureMethod · 0.72