# junit_xml

URL: /kida/api/utils/junit_xml/
Section: utils
Description: 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.

---

> For a complete page index, fetch /kida/llms.txt.

Open LLM text
(/kida/api/utils/junit_xml/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Futils%2Fjunit_xml%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Futils%2Fjunit_xml%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Futils%2Fjunit_xml%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Futils%2Fjunit_xml%2Findex.txt)

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.

4Classes1Function

## 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`
