Unit Test Summaryο
π§ This is a work-in-progress feature. π§
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.
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 calledsrc
(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", } }
Add the
report: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 report: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ο
Rolesο
There are no roles defined.