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

Method test_rewrite

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

Source from the content-addressed store, hash-verified

345 result.stdout.fnmatch_lines(["collected 1 item"])
346
347 def test_rewrite(self, pytester: Pytester, monkeypatch) -> None:
348 config = pytester.parseconfig()
349 f = StringIO()
350 monkeypatch.setattr(f, "isatty", lambda *args: True)
351 tr = TerminalReporter(config, f)
352 tr._tw.fullwidth = 10
353 tr.write("hello")
354 tr.rewrite("hey", erase=True)
355 assert f.getvalue() == "hello" + "\r" + "hey" + (6 * " ")
356
357 @pytest.mark.parametrize("category", ["foo", "failed", "error", "passed"])
358 def test_report_teststatus_explicit_markup(

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