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

Method test_rewrite

testing/test_terminal.py:315–323  ·  view source on GitHub ↗
(self, pytester: Pytester, monkeypatch)

Source from the content-addressed store, hash-verified

313 result.stdout.fnmatch_lines(["collected 1 item"])
314
315 def test_rewrite(self, pytester: Pytester, monkeypatch) -> None:
316 config = pytester.parseconfig()
317 f = StringIO()
318 monkeypatch.setattr(f, "isatty", lambda *args: True)
319 tr = TerminalReporter(config, f)
320 tr._tw.fullwidth = 10
321 tr.write("hello")
322 tr.rewrite("hey", erase=True)
323 assert f.getvalue() == "hello" + "\r" + "hey" + (6 * " ")
324
325 def test_report_teststatus_explicit_markup(
326 self, monkeypatch: MonkeyPatch, pytester: Pytester, color_mapping

Callers

nothing calls this directly

Calls 6

writeMethod · 0.95
rewriteMethod · 0.95
TerminalReporterClass · 0.90
setattrMethod · 0.80
parseconfigMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected