junitparser.xunit2 module

The flavor based on Jenkins xunit plugin: https://github.com/jenkinsci/xunit-plugin/blob/xunit-2.3.2/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd

According to the internet, the schema is compatible with:

  • Pytest (as default, though it also supports a “legacy” xunit1 flavor)

  • Erlang/OTP

  • Maven Surefire

  • CppTest

There may be many others that I’m not aware of.

class junitparser.xunit2.FlakyError(message: str = None, type_: str = None)[source]

Bases: RerunType

class junitparser.xunit2.FlakyFailure(message: str = None, type_: str = None)[source]

Bases: RerunType

class junitparser.xunit2.JUnitXml(name=None)[source]

Bases: JUnitXml

skipped = None
update_statistics()[source]

Update test count, time, etc.

class junitparser.xunit2.RerunError(message: str = None, type_: str = None)[source]

Bases: RerunType

class junitparser.xunit2.RerunFailure(message: str = None, type_: str = None)[source]

Bases: RerunType

class junitparser.xunit2.RerunType(message: str = None, type_: str = None)[source]

Bases: Result

property stack_trace

<stackTrace>

property system_err

<system-err>

property system_out

<system-out>

class junitparser.xunit2.StackTrace(content: str = None)[source]

Bases: System

class junitparser.xunit2.TestCase(name: str = None, classname: str = None, time: float = None)[source]

Bases: TestCase

add_rerun_result(result: RerunType)[source]

Append a rerun result to the testcase. A testcase can have multiple rerun results.

flaky_errors()[source]

<flakyError>

flaky_failures()[source]

<flakyFailure>

group

An attribute for an XML element.

By default they are all string values. To support different value types, inherit this class and define your own methods.

Also see: IntAttr, FloatAttr.

rerun_errors()[source]

<rerunError>

rerun_failures()[source]

<rerunFailure>

class junitparser.xunit2.TestSuite(name=None)[source]

Bases: TestSuite

TestSuite for Pytest, with some different attributes.

file

An attribute for an XML element.

By default they are all string values. To support different value types, inherit this class and define your own methods.

Also see: IntAttr, FloatAttr.

group

An attribute for an XML element.

By default they are all string values. To support different value types, inherit this class and define your own methods.

Also see: IntAttr, FloatAttr.

id

An attribute for an XML element.

By default they are all string values. To support different value types, inherit this class and define your own methods.

Also see: IntAttr, FloatAttr.

log

An attribute for an XML element.

By default they are all string values. To support different value types, inherit this class and define your own methods.

Also see: IntAttr, FloatAttr.

package

An attribute for an XML element.

By default they are all string values. To support different value types, inherit this class and define your own methods.

Also see: IntAttr, FloatAttr.

property system_err

<system-err>

property system_out

<system-out>

url

An attribute for an XML element.

By default they are all string values. To support different value types, inherit this class and define your own methods.

Also see: IntAttr, FloatAttr.

version

An attribute for an XML element.

By default they are all string values. To support different value types, inherit this class and define your own methods.

Also see: IntAttr, FloatAttr.