Skip to content

Commit ff50860

Browse files
dawngerponyionelmc
authored andcommitted
docs: add config instructions for pyproject.toml.
1 parent 4a5a4b5 commit ff50860

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: docs/config.rst

+9-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,19 @@ For full details refer to the `coverage config file`_ documentation.
3232

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

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

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

43+
Or for ``pyproject.toml``: ::
44+
45+
[tool.pytest.ini_options]
46+
addopts = "--cov=<project-name> --cov-report html"
47+
4148
Caveats
4249
=======
4350

0 commit comments

Comments
 (0)