Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update config.rst wrt ignored .coveragerc settings #429

Merged
merged 2 commits into from Sep 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions docs/config.rst
Expand Up @@ -21,9 +21,16 @@ For full details refer to the `coverage config file`_ documentation.

.. _`coverage config file`: https://coverage.readthedocs.io/en/latest/config.html

Note that this plugin controls some options and setting the option in the config file will have no
effect. These include specifying source to be measured (source option) and all data file handling
(data_file and parallel options).
.. note:: Important Note

This plugin overrides the ``data_file`` and ``parallel`` options of coverage. Unless you also run coverage without
pytest-cov it's pointless to set those options in your ``.coveragerc``.

If you use the ``--cov=something`` option (with a value) then coverage's ``source`` option will also get overriden.
If you have multiple sources it might be easier to set those in ``.coveragerc`` and always use ``--cov`` (wihout a value)
instead of having a long command line with ``--cov=pkg1 --cov=pkg2 --cov=pkg3 ...``.

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

If you wish to always add pytest-cov with pytest, you can use ``addopts`` under ``pytest`` or ``tool:pytest`` section.
For example: ::
Expand Down