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

Method test_writeline

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

Source from the content-addressed store, hash-verified

117 linecomp.assert_contains_lines(["INTERNALERROR> *ValueError*hello*"])
118
119 def test_writeline(self, pytester: Pytester, linecomp) -> None:
120 modcol = pytester.getmodulecol("def test_one(): pass")
121 rep = TerminalReporter(modcol.config, file=linecomp.stringio)
122 rep.write_fspath_result(modcol.nodeid, ".")
123 rep.write_line("hello world")
124 lines = linecomp.stringio.getvalue().split("\n")
125 assert not lines[0]
126 assert lines[1].endswith(modcol.name + " .")
127 assert lines[2] == "hello world"
128
129 def test_show_runtest_logstart(self, pytester: Pytester, linecomp) -> None:
130 item = pytester.getitem("def test_func(): pass")

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected