Add config parameter to pytest_report_teststatus hook
This commit is contained in:
parent
9905a73ae0
commit
5b09eb1d74
|
@ -481,9 +481,11 @@ def pytest_report_collectionfinish(config, startdir, items):
|
|||
|
||||
|
||||
@hookspec(firstresult=True)
|
||||
def pytest_report_teststatus(report):
|
||||
def pytest_report_teststatus(report, config):
|
||||
""" return result-category, shortletter and verbose word for reporting.
|
||||
|
||||
:param _pytest.config.Config config: pytest config object
|
||||
|
||||
Stops at first non-None result, see :ref:`firstresult` """
|
||||
|
||||
|
||||
|
|
|
@ -66,7 +66,9 @@ class ResultLog(object):
|
|||
def pytest_runtest_logreport(self, report):
|
||||
if report.when != "call" and report.passed:
|
||||
return
|
||||
res = self.config.hook.pytest_report_teststatus(report=report)
|
||||
res = self.config.hook.pytest_report_teststatus(
|
||||
report=report, config=self.config
|
||||
)
|
||||
code = res[1]
|
||||
if code == "x":
|
||||
longrepr = str(report.longrepr)
|
||||
|
|
|
@ -363,7 +363,7 @@ class TerminalReporter(object):
|
|||
|
||||
def pytest_runtest_logreport(self, report):
|
||||
rep = report
|
||||
res = self.config.hook.pytest_report_teststatus(report=rep)
|
||||
res = self.config.hook.pytest_report_teststatus(report=rep, config=self.config)
|
||||
category, letter, word = res
|
||||
if isinstance(word, tuple):
|
||||
word, markup = word
|
||||
|
|
Loading…
Reference in New Issue