Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions junit_xml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ def build_xml_doc(self, encoding=None):
stderr_element.text = decode(case.stderr, encoding)
test_case_element.append(stderr_element)

# test properties
if case.properties:
props_element = ET.Element("properties")
for k, v in case.properties.items():
attrs = {"name": decode(k, encoding), "value": decode(v, encoding)}
ET.SubElement(props_element, "property", attrs)
test_case_element.append(props_element)

return xml_element

@staticmethod
Expand Down Expand Up @@ -380,6 +388,7 @@ def __init__(
log=None,
url=None,
allow_multiple_subelements=False,
properties=None,
):
self.name = name
self.assertions = assertions
Expand All @@ -400,6 +409,7 @@ def __init__(
self.failures = []
self.skipped = []
self.allow_multiple_subalements = allow_multiple_subelements
self.properties = properties

def add_error_info(self, message=None, output=None, error_type=None):
"""Adds an error message, output, or both to the test case"""
Expand Down