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

Method __str__

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

Source from the content-addressed store, hash-verified

297 return tbh
298
299 def __str__(self) -> str:
300 name = self.frame.code.name
301 try:
302 line = str(self.statement).lstrip()
303 except KeyboardInterrupt:
304 raise
305 except BaseException:
306 line = "???"
307 # This output does not quite match Python's repr for traceback entries,
308 # but changing it to do so would break certain plugins. See
309 # https://github.com/pytest-dev/pytest/pull/7535/ for details.
310 return " File %r:%d in %s\n %s\n" % (
311 str(self.path),
312 self.lineno + 1,
313 name,
314 line,
315 )
316
317 @property
318 def name(self) -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected