From 4cbc27b96cba7e5352a80b244123ef5c3a8b6a27 Mon Sep 17 00:00:00 2001 From: jitendracandela Date: Fri, 18 Oct 2024 14:54:48 +0530 Subject: [PATCH] Modified pytest exit code Signed-off-by: jitendracandela --- tests/conftest.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 7e77fdd7d4..4b5e382442 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -538,12 +538,8 @@ def collect_logs(): query="?logType=2") allure.attach(body=json.dumps(resp.json(), indent=4), name="all_device_reboot_logs\n", attachment_type=allure.attachment_type.JSON) - try: - pytest.fail("AP crashed during the test") - logging.info("AP crashed during the test") - except Exception as e: - logging.info("In the crash exception:- " + str(e)) - pytest.exit(1) + logging.info("AP crashed during the test") + pytest.exit("AP crashed during the test", 2) else: logging.info("resp.status_code:- " + str(resp.status_code))