Skip to content

Commit b8dd29c

Browse files
authored
fix: ensure testsuite is a list in xray extract_test_results (#564)
1 parent 840b72e commit b8dd29c

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pykiso"
3-
version = "1.6.1"
3+
version = "1.6.2"
44
description = "Embedded integration testing framework."
55
authors = ["Sebastian Fischer <sebastian.fischer@de.bosch.com>"]
66
license = "Eclipse Public License - v 2.0"

src/pykiso/tool/xray/xray.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,12 @@ def extract_test_results(
354354
# use xml to json
355355
for file in file_to_parse:
356356
with open(file) as xml_file:
357-
data_dict = xmltodict.parse(xml_file.read(), attr_prefix="")
357+
# Ensure 'testsuite' is always a list for consistent processing.
358+
data_dict = xmltodict.parse(xml_file.read(), attr_prefix="", force_list=("testsuite",))
358359

360+
test_suites = data_dict["testsuites"]["testsuite"]
359361
xray_dict = create_result_dictionary(
360-
data_dict["testsuites"]["testsuite"], jira_keys, test_execution_summary, test_execution_description
362+
test_suites, jira_keys, test_execution_summary, test_execution_description
361363
)
362364
xml_results = reformat_xml_results(xray_dict, test_execution_key)
363365
return xml_results

0 commit comments

Comments
 (0)