From 89756c29213f11082bf7628ffc653ae783bfb15f Mon Sep 17 00:00:00 2001 From: Claudio Klingler Date: Fri, 18 Nov 2022 00:42:16 +0100 Subject: [PATCH 1/2] Support TestCase-id. --- junit_xml/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/junit_xml/__init__.py b/junit_xml/__init__.py index 0cfef29..bb9ee0c 100644 --- a/junit_xml/__init__.py +++ b/junit_xml/__init__.py @@ -148,6 +148,8 @@ def build_xml_doc(self, encoding=None): test_suite_attributes["log"] = decode(self.log, encoding) if self.url: test_suite_attributes["url"] = decode(self.url, encoding) + if self.id: + test_suite_attributes["id"] = decode(self.id, encoding) xml_element = ET.Element("testsuite", test_suite_attributes) @@ -191,6 +193,8 @@ def build_xml_doc(self, encoding=None): test_case_attributes["line"] = decode(case.line, encoding) if case.log: test_case_attributes["log"] = decode(case.log, encoding) + if case.id: + test_case_attributes["id"] = decode(case.id, encoding) if case.url: test_case_attributes["url"] = decode(case.url, encoding) @@ -380,6 +384,7 @@ def __init__( log=None, url=None, allow_multiple_subelements=False, + id=None ): self.name = name self.assertions = assertions From 7ffa968bfe49dfec7fbb9e5950120deda99f1ebf Mon Sep 17 00:00:00 2001 From: Claudio Klingler Date: Fri, 18 Nov 2022 01:22:37 +0100 Subject: [PATCH 2/2] initialise TestCase.id. --- junit_xml/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/junit_xml/__init__.py b/junit_xml/__init__.py index bb9ee0c..edab3e1 100644 --- a/junit_xml/__init__.py +++ b/junit_xml/__init__.py @@ -399,6 +399,7 @@ def __init__( self.url = url self.stdout = stdout self.stderr = stderr + self.id = id self.is_enabled = True self.errors = []