From 5bd95135023b0d12c6fb69d0f4203598d5f9093d Mon Sep 17 00:00:00 2001 From: danceratopz Date: Thu, 23 May 2024 16:57:30 +0200 Subject: [PATCH] fix(consume): correctly forward setup error to hive server (#569) --- src/pytest_plugins/pytest_hive/pytest_hive.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pytest_plugins/pytest_hive/pytest_hive.py b/src/pytest_plugins/pytest_hive/pytest_hive.py index 0fda7c0c00..28537675d5 100644 --- a/src/pytest_plugins/pytest_hive/pytest_hive.py +++ b/src/pytest_plugins/pytest_hive/pytest_hive.py @@ -124,7 +124,12 @@ def hive_test(request, test_suite: HiveTestSuite): test_result_details = request.node.result_call.longreprtext elif hasattr(request.node, "result_setup") and not request.node.result_setup.passed: test_passed = False - test_result_details = "Test setup failed.\n" + request.node.result_call.longreprtext + test_result_details = "Test setup failed.\n" + request.node.result_setup.longreprtext + elif hasattr(request.node, "result_teardown") and not request.node.result_teardown.passed: + test_passed = False + test_result_details = ( + "Test teardown failed.\n" + request.node.result_teardown.longreprtext + ) else: test_passed = False test_result_details = "Test failed for unknown reason (setup or call status unknown)."