Module

utils.junit_xml

JUnit XML to dict converter for Kida CI report templates.

Stdlib-only converter using xml.etree.ElementTree. Handles both pytest and ty JUnit XML output variants.

Classes

JUnitTestCase 6 ▼
A single test case result.

A single test case result.

Attributes

Name Type Description
name str —
classname str —
time float —
status str —
message str | None —
text str | None —
JUnitSummary 6 ▼
Aggregate test counts and timing.

Aggregate test counts and timing.

Attributes

Name Type Description
total int —
passed int —
failed int —
errors int —
skipped int —
time float —
JUnitTestSuite 7 ▼
A single test suite with its test cases.

A single test suite with its test cases.

Attributes

Name Type Description
name str —
tests int —
failures int —
errors int —
skipped int —
time float —
testcases list[JUnitTestCase] —
JUnitReport 2 ▼
Top-level JUnit XML parse result.

Top-level JUnit XML parse result.

Attributes

Name Type Description
summary JUnitSummary —
testsuites list[JUnitTestSuite] —

Functions

junit_to_dict 1 JUnitReport ▼
Parse a JUnit XML file and return a structured dict.
def junit_to_dict(path: str | Path) -> JUnitReport
Parameters
Name Type Description
path str | Path

Path to the JUnit XML file.

Returns
JUnitReport