From a8cf8a18a1d713dcc660a5ab73331d12909f2913 Mon Sep 17 00:00:00 2001 From: Alex Martani Date: Mon, 9 Jan 2023 17:44:49 -0800 Subject: [PATCH] Set --junitxml when corresponding environment variable is available --- python_pytest/pytest_shim.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python_pytest/pytest_shim.py b/python_pytest/pytest_shim.py index 67ed814..a17398b 100644 --- a/python_pytest/pytest_shim.py +++ b/python_pytest/pytest_shim.py @@ -9,6 +9,9 @@ if __name__ == "__main__": pytest_args = ["--ignore=external"] + if os.environ.get("XML_OUTPUT_FILE"): + pytest_args.append("--junitxml={xml_output_file}".format(xml_output_file=os.environ.get("XML_OUTPUT_FILE"))) + if os.environ.get("TESTBRIDGE_TEST_ONLY"): # TestClass.test_fn -> TestClass::test_fn module_name = os.environ.get("TESTBRIDGE_TEST_ONLY").replace(".", "::")