test-framework: Fail the test if something broke in prepare

Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
This commit is contained in:
Kamil Gierszewski 2024-10-30 00:57:12 +01:00
parent 0edba4f01b
commit 6ea1c16066
No known key found for this signature in database

View File

@ -186,8 +186,6 @@ TestRun.setup = __setup
@classmethod @classmethod
def __makereport(cls, item, call, res): def __makereport(cls, item, call, res):
if cls.LOGGER is None:
return None
cls.outcome = res.outcome cls.outcome = res.outcome
step_info = { step_info = {
'result': res.outcome, 'result': res.outcome,
@ -213,7 +211,7 @@ def __makereport(cls, item, call, res):
if res.outcome == "skipped": if res.outcome == "skipped":
cls.LOGGER.skip("Test skipped.") cls.LOGGER.skip("Test skipped.")
if res.when == "call" and cls.LOGGER.get_result() == BaseLogResult.FAILED: if res.when in ["call", "setup"] and cls.LOGGER.get_result() >= BaseLogResult.FAILED:
res.outcome = "failed" res.outcome = "failed"
# To print additional message in final test report, assign it to res.longrepr # To print additional message in final test report, assign it to res.longrepr