Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/user_guide.rst
Original file line number Diff line number Diff line change
@@ -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
----------

Expand Down