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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user