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

Method test_pytest_report_header

testing/test_terminal.py:1636–1653  ·  testing/test_terminal.py::TestGenericReporting.test_pytest_report_header
(self, pytester: Pytester, option)

Source from the content-addressed store, hash-verified

1634 result.stdout.fnmatch_lines([fclass="st">"*{bn}:3: Failed: test_func1"])
1635
1636 def test_pytest_report_header(self, pytester: Pytester, option) -> None:
1637 pytester.makeconftest(
1638 class="st">"""
1639 def pytest_sessionstart(session):
1640 session.config._somevalue = 42
1641 def pytest_report_header(config):
1642 return class="st">"hello: %s" % config._somevalue
1643 class="st">"""
1644 )
1645 pytester.mkdir(class="st">"a").joinpath(class="st">"conftest.py").write_text(
1646 class="st">"""
1647def pytest_report_header(config, start_path):
1648 return [class="st">"line1", str(start_path)]
1649class="st">""",
1650 encoding=class="st">"utf-8",
1651 )
1652 result = pytester.runpytest(class="st">"a")
1653 result.stdout.fnmatch_lines([class="st">"*hello: 42*", class="st">"line1", str(pytester.path)])
1654
1655 def test_show_capture(self, pytester: Pytester) -> None:
1656 pytester.makepyfile(

Callers

nothing calls this directly

Calls 5

write_textMethod · 0.80
fnmatch_linesMethod · 0.80
makeconftestMethod · 0.45
mkdirMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected