introduce a new pytest_report_header(hook) hook to add additional test-run relevant information to the header of a test report.

--HG--
branch : trunk
This commit is contained in:
holger krekel
2010-01-12 21:43:25 +01:00
parent 676081b87a
commit d53572a710
6 changed files with 56 additions and 32 deletions

View File

@@ -289,6 +289,22 @@ class TestTerminal:
])
result.stdout.fnmatch_lines(['*KEYBOARD INTERRUPT*'])
def test_pytest_report_header(self, testdir):
testdir.makeconftest("""
def pytest_report_header(config):
return "hello: info"
""")
testdir.mkdir("a").join("conftest.py").write("""if 1:
def pytest_report_header(config):
return ["line1", "line2"]
""")
result = testdir.runpytest("a")
result.stdout.fnmatch_lines([
"*hello: info*",
"line1",
"line2",
])
class TestCollectonly:
def test_collectonly_basic(self, testdir, linecomp):