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

Method test_writeline

testing/test_terminal.py:151–159  ·  view source on GitHub ↗
(self, pytester: Pytester, linecomp)

Source from the content-addressed store, hash-verified

149 linecomp.assert_contains_lines(["INTERNALERROR> *ValueError*hello*"])
150
151 def test_writeline(self, pytester: Pytester, linecomp) -> None:
152 modcol = pytester.getmodulecol("def test_one(): pass")
153 rep = TerminalReporter(modcol.config, file=linecomp.stringio)
154 rep.write_fspath_result(modcol.nodeid, ".")
155 rep.write_line("hello world")
156 lines = linecomp.stringio.getvalue().split("\n")
157 assert not lines[0]
158 assert lines[1].endswith(modcol.name + " .")
159 assert lines[2] == "hello world"
160
161 def test_show_runtest_logstart(self, pytester: Pytester, linecomp) -> None:
162 item = pytester.getitem("def test_func(): pass")

Callers

nothing calls this directly

Calls 6

write_fspath_resultMethod · 0.95
write_lineMethod · 0.95
TerminalReporterClass · 0.90
endswithMethod · 0.80
getmodulecolMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected