junit#

junit_reporter() CanaryReporter#
class JunitReporter#

Bases: CanaryReporter

type: str = 'junit'#
description: str = 'JUnit reporter'#
default_output: str = 'junit.xml'#
create(**kwargs: Any) None#
get_root_name() str#
groupby_classname(cases: list[TestCase]) dict[str, list[TestCase]]#

Group tests by status

get_classname(case: TestCase) str#
class JunitDocument#

Bases: Document

create_element(tagname: str) Element#
create_cdata_node(text: str) Text#
create_testsuite_element(cases: list[TestCase], tagname: str = 'testsuite', **attrs: str) Element#

Create a testcase element with the following structure

<testsuite tests="..." errors="..." skipped="..." failures="..." time="..." timestamp="...">
</testsuite>
create_testcase_element(case: TestCase) Element#

Create a testcase element with the following structure:

doctype#
childNodes#
gather_statistics(cases: list[TestCase]) SimpleNamespace#
cleanup_text(text: str, escape: bool = False) str#