From ff50860d7c67b920503745d92a3f0944cf41f982 Mon Sep 17 00:00:00 2001 From: Dawn James Date: Mon, 25 Dec 2023 07:45:31 +0000 Subject: [PATCH] docs: add config instructions for pyproject.toml. --- docs/config.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index c7bef037..852c014b 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -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= --cov-report html +Or for ``pyproject.toml``: :: + + [tool.pytest.ini_options] + addopts = "--cov= --cov-report html" + Caveats =======