Skip to content

Commit

Permalink
docs: add config instructions for pyproject.toml.
Browse files Browse the repository at this point in the history
  • Loading branch information
dawngerpony authored and ionelmc committed Mar 18, 2024
1 parent 4a5a4b5 commit ff50860
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/config.rst
Expand Up @@ -32,12 +32,19 @@ For full details refer to the `coverage config file`_ documentation.

If you use the ``--cov-branch`` option then coverage's ``branch`` option will also get overridden.

If you wish to always add pytest-cov with pytest, you can use ``addopts`` under ``pytest`` or ``tool:pytest`` section.
For example: ::
If you wish to always add pytest-cov with pytest, you can use ``addopts`` under the ``pytest`` or ``tool:pytest`` section of
your ``setup.cfg``, or the ``tool.pytest.ini_options`` section of your ``pyproject.toml`` file.

For example, in ``setup.cfg``: ::

[tool:pytest]
addopts = --cov=<project-name> --cov-report html

Or for ``pyproject.toml``: ::

[tool.pytest.ini_options]
addopts = "--cov=<project-name> --cov-report html"

Caveats
=======

Expand Down

0 comments on commit ff50860

Please sign in to comment.