This commit is contained in:
Stefaan Lippens 2025-04-14 15:27:02 +00:00 committed by GitHub
commit d1654f7d0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 0 deletions

View File

@ -1,6 +1,31 @@
User Guide
==========
Make sure the pytest-html plugin is installed in your test or development environment,
e.g. by manually installing it with ``pip install pytest-html``.
For more streamlined reproducibility: consider listing it as a (test/development) dependency
in the appropriate project configuration file (e.g. ``pyproject.toml`` or ``requirements.txt``).
Once installed, you can produce a HTML report from a ``pytest`` run
by adding the ``--html`` command line option, e.g.:
.. code-block:: bash
$ pytest --html=report.html
By default, this will create a HTML file ``report.html`` and an ``assets`` folder
for additional resources like CSS files and images.
.. tip::
Use a dedicated parent folder for reports,
e.g. with ``--html=test-reports/report.html``,
to avoid polluting your project root with report assets.
pytest-html will automatically create parent folders when necessary.
Also consider setting up appropriate version control ignore rules (e.g. ``.gitignore``)
to avoid accidental commit of these output resources.
ANSI codes
----------