[mq]: rename

--HG--
branch : 1.0.x
This commit is contained in:
holger krekel 2009-08-06 15:02:38 +02:00
parent afc8e6bd91
commit cea46a86aa
5 changed files with 17 additions and 16 deletions

View File

@ -7,6 +7,8 @@ Changes between 1.0.0 and 1.0.1
* terser reporting of collection error tracebacks, now skips py-internals
* renaming of arguments to some special rather internal hooks
Changes between 1.0.0b9 and 1.0.0
=====================================

View File

@ -91,7 +91,7 @@ def pytest__teardown_final(session):
""" called before test session finishes. """
pytest__teardown_final.firstresult = True
def pytest__teardown_final_logerror(rep):
def pytest__teardown_final_logerror(report):
""" called if runtest_teardown_final failed. """
# -------------------------------------------------------------------------
@ -108,8 +108,8 @@ def pytest_sessionfinish(session, exitstatus):
# hooks for influencing reporting (invoked from pytest_terminal)
# -------------------------------------------------------------------------
def pytest_report_teststatus(rep):
""" return shortletter and verbose word. """
def pytest_report_teststatus(report):
""" return result-category, shortletter and verbose word for reporting."""
pytest_report_teststatus.firstresult = True
def pytest_terminal_summary(terminalreporter):

View File

@ -24,7 +24,7 @@ def pytest_sessionfinish(session, exitstatus):
hook = session.config.hook
rep = hook.pytest__teardown_final(session=session)
if rep:
hook.pytest__teardown_final_logerror(rep=rep)
hook.pytest__teardown_final_logerror(report=rep)
def pytest_make_collect_report(collector):
result = excinfo = None
@ -72,12 +72,12 @@ def pytest__teardown_final(session):
rep = TeardownErrorReport(call.excinfo)
return rep
def pytest_report_teststatus(rep):
if rep.when in ("setup", "teardown"):
if rep.failed:
def pytest_report_teststatus(report):
if report.when in ("setup", "teardown"):
if report.failed:
# category, shortletter, verbose-word
return "error", "E", "ERROR"
elif rep.skipped:
elif report.skipped:
return "skipped", "s", "SKIPPED"
else:
return "", "", ""

View File

@ -82,7 +82,7 @@ class TerminalReporter:
self._tw.sep(sep, title, **markup)
def getcategoryletterword(self, rep):
res = self.config.hook.pytest_report_teststatus(rep=rep)
res = self.config.hook.pytest_report_teststatus(report=rep)
if res:
return res
for cat in 'skipped failed passed ???'.split():
@ -184,8 +184,8 @@ class TerminalReporter:
fspath, lineno, msg = self._getreportinfo(item)
self.write_fspath_result(fspath, "")
def pytest__teardown_final_logerror(self, rep):
self.stats.setdefault("error", []).append(rep)
def pytest__teardown_final_logerror(self, report):
self.stats.setdefault("error", []).append(report)
def pytest_runtest_logreport(self, report):
rep = report

View File

@ -35,12 +35,11 @@ def pytest_runtest_makereport(__call__, item, call):
res.failed = True
return res
def pytest_report_teststatus(rep):
""" return shortletter and verbose word. """
if 'xfail' in rep.keywords:
if rep.skipped:
def pytest_report_teststatus(report):
if 'xfail' in report.keywords:
if report.skipped:
return "xfailed", "x", "xfail"
elif rep.failed:
elif report.failed:
return "xpassed", "P", "xpass"
# called by the terminalreporter instance/plugin