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

Method toterminal

src/_pytest/fixtures.py:882–898  ·  view source on GitHub ↗
(self, tw: TerminalWriter)

Source from the content-addressed store, hash-verified

880 self.argname = argname
881
882 def toterminal(self, tw: TerminalWriter) -> None:
883 # tw.line("FixtureLookupError: %s" %(self.argname), red=True)
884 for tbline in self.tblines:
885 tw.line(tbline.rstrip())
886 lines = self.errorstring.split("\n")
887 if lines:
888 tw.line(
889 f"{FormattedExcinfo.fail_marker} {lines[0].strip()}",
890 red=True,
891 )
892 for line in lines[1:]:
893 tw.line(
894 f"{FormattedExcinfo.flow_marker} {line.strip()}",
895 red=True,
896 )
897 tw.line()
898 tw.line("%s:%d" % (os.fspath(self.filename), self.firstlineno + 1))
899
900
901def fail_fixturefunc(fixturefunc, msg: str) -> "NoReturn":

Callers

nothing calls this directly

Calls 3

stripMethod · 0.80
fspathMethod · 0.80
lineMethod · 0.45

Tested by

no test coverage detected