Unit Test Summary

🚧 This is a work-in-progress feature. 🚧

execution framework like pytest.

Supported report generators

Quick Configuration

See the overview page on how to setup and enable the Sphinx extension in general.

Note

This is a quick and minimal configuration. See below detailed explanations.

  1. Configure one or more unitest summary reports in conf.py by adding a new β€˜section’ defining some configuration variables. Each summary report is identified by an ID, which is later referred to by the report directive. Here, the ID is called src (dictionary key). Each analysis report needs 2 configuration entries:

    name

    Name of the Python package[#PkgNameVsPkgDir]_.

    xml_report

    The code coverage report as JSON file as generated by Coverage.py.

    # ==============================================================================
    # Sphinx-reports - Unittest
    # ==============================================================================
    report_codecov_packages = {
       "src": {
          "name":       "myPackage",
          "xml_report": "../report/unit/unittest.xml",
       }
    }
    
  2. Add the unittest-summary directive into your Restructured Text (ReST) document.

    .. report:unittest-summary::
       :reportid: src
    

Example Document

The following unittest/index document is an example on how this documentation uses the unittest-summary directive. The first file consists of three parts: At first, a headline; at second second a short introduction paragraph and at third, the report generating directive. The second file shows how to integrate that document into the navigation bar.

unittest/index.rst

Unittest Summary Report
#######################

Code coverage report generated with `pytest <https://github.com/pytest-dev/pytest>`__.

.. report:unittest-summary::
   :reportid: src

index.rst

.. toctree::
   :caption: References and Reports
   :hidden:

   sphinx_reports/sphinx_reports
   unittests/index
   coverage/index
   Doc. Coverage Report <DocCoverage>
   Static Type Check Report ➚ <typing/index>

.. toctree::
   :caption: Appendix
   :hidden:

Directives

.. unittest-summary::

Add a table summarizing the unittest results.

:reportid:

An identifier referencing a dictionary entry in the configuration variable report_unittest_testsuites defined in conf.py.

Roles

There are no roles defined.