License Supported versions https://readthedocs.org/projects/sphinx-test-reports/badge/?version=latest Travis-CI Build Status PyPI Package latest release

Sphinx-Test-Reports

Sphinx-Test-Reports shows test results inside Sphinx documentations.

Functions

  • Shows test results of JUnit based xml reports as table. JUnit exports are supported by:
    • pytest
    • nosetest
    • Other test frameworks (including frameworks from java and co.) support also the JUnit format.
  • Shows test environment information from tox-envreport based exports as table. (E.g. used operating system, python version, installed packages, …)

Note

This plugin is in an early alpha phase and under heavy development.

Example

Input

my_data.xml

<testsuite name="My testsuite" tests="4" failures="1" errors="0" skips="1" time="0.572" >
    <testcase classname="test_basic_doc" name="test_doc_build_html"/>
    <testcase classname="test_empty_doc" name="test_doc_build_html"/>
    <testcase classname="test_junit_parser" name="test_init_parser">
        <failure type="KeyException"> key "name" could not be accessed in junit object </failure>
    </testcase>
    <testcase classname="test_junit_parser" name="test_call_parser">
        <skipped > Passed on the last test run </skipped>
    </testcase>
</testsuite>

my_document.rst

My Test Results
===============

.. test-results:: my_data.xml

Output

My testsuite

Tests: 4, Failures: 1, Errors: 0, Skips: 1

Time: 0.572

class name status reason

test_basic_doc

test_doc_build_html

passed

test_empty_doc

test_doc_build_html

passed

test_junit_parser

test_init_parser

failure

key “name” could not be accessed in junit object

test_junit_parser

test_call_parser

skipped

Passed on the last test run

Motivation

Sphinx-Test-Reports was created for an automotive project, which needs to document test results and their used environment configuration in an human-readable format. The goal is to provide enough information to be able to setup an identical test environment in 20+ years.

Sphinx-Test-Reports is part of a software bundle, which was designed to fulfill the parameters of the ISO 26262 standard for safety critical software in automotive companies.

Other tools are: sphinx-needs and tox-envreport

Content

Contents: