Use TestRun.makereport()

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2019-11-29 10:55:47 +01:00
parent 263f3137da
commit a53846953c
2 changed files with 2 additions and 11 deletions

@ -1 +1 @@
Subproject commit 1c075f00dd6b02e9c563b10d35dc497a61c59225
Subproject commit 0910d7f45e9f9ae05b0cf4b2fc1e802269b7f3ce

View File

@ -97,16 +97,7 @@ def pytest_runtest_setup(item):
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
res = (yield).get_result()
TestRun.outcome = res.outcome
from _pytest.outcomes import Failed
if res.when == "call" and res.failed:
msg = f"{call.excinfo.type.__name__}: {call.excinfo.value}"
if call.excinfo.type is Failed:
TestRun.LOGGER.error(msg)
else:
TestRun.LOGGER.exception(msg)
TestRun.makereport(item, call, res)
def pytest_runtest_teardown():