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

Method test_pytest_report_header

testing/test_terminal.py:1453–1469  ·  view source on GitHub ↗
(self, pytester: Pytester, option)

Source from the content-addressed store, hash-verified

1451 assert "def test_func2" not in s
1452
1453 def test_pytest_report_header(self, pytester: Pytester, option) -> None:
1454 pytester.makeconftest(
1455 """
1456 def pytest_sessionstart(session):
1457 session.config._somevalue = 42
1458 def pytest_report_header(config):
1459 return "hello: %s" % config._somevalue
1460 """
1461 )
1462 pytester.mkdir("a").joinpath("conftest.py").write_text(
1463 """
1464def pytest_report_header(config, start_path):
1465 return ["line1", str(start_path)]
1466"""
1467 )
1468 result = pytester.runpytest("a")
1469 result.stdout.fnmatch_lines(["*hello: 42*", "line1", str(pytester.path)])
1470
1471 def test_show_capture(self, pytester: Pytester) -> None:
1472 pytester.makepyfile(

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected