From a3362727cc0d48113323f2ec4d5d895ef50d96ba Mon Sep 17 00:00:00 2001 From: Aleksei Apaseev Date: Mon, 23 Oct 2023 18:59:25 +0800 Subject: [PATCH] ci: assign the test_case_name attribute to the case item while setting up a pytest session --- conftest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conftest.py b/conftest.py index 06ed3a81a15..cf127e7fe98 100644 --- a/conftest.py +++ b/conftest.py @@ -146,6 +146,11 @@ def junit_properties(test_case_name: str, record_xml_attribute: Callable[[str, o record_xml_attribute('name', test_case_name) +@pytest.fixture(autouse=True) +def set_test_case_name(request: FixtureRequest, test_case_name: str) -> None: + request.node.funcargs['test_case_name'] = test_case_name + + ###################### # Log Util Functions # ######################