Use TestRun.makereport()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
parent
263f3137da
commit
a53846953c
@ -1 +1 @@
|
|||||||
Subproject commit 1c075f00dd6b02e9c563b10d35dc497a61c59225
|
Subproject commit 0910d7f45e9f9ae05b0cf4b2fc1e802269b7f3ce
|
@ -97,16 +97,7 @@ def pytest_runtest_setup(item):
|
|||||||
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
|
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
|
||||||
def pytest_runtest_makereport(item, call):
|
def pytest_runtest_makereport(item, call):
|
||||||
res = (yield).get_result()
|
res = (yield).get_result()
|
||||||
|
TestRun.makereport(item, call, res)
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
||||||
def pytest_runtest_teardown():
|
def pytest_runtest_teardown():
|
||||||
|
Loading…
Reference in New Issue
Block a user