Document collect_ignore and collect_ignore_glob in reference

This commit is contained in:
Christian Fetzer 2019-02-06 17:15:28 +01:00
parent 2dc2a19db5
commit 1876a928d3
1 changed files with 27 additions and 0 deletions

View File

@ -797,6 +797,33 @@ Special Variables
pytest treats some global variables in a special manner when defined in a test module.
collect_ignore
~~~~~~~~~~~~~~
**Tutorial**: :ref:`customizing-test-collection`
Can be declared in *conftest.py files* to exclude test directories or modules.
Needs to be ``list[str]``.
.. code-block:: python
collect_ignore = ["setup.py"]
collect_ignore_glob
~~~~~~~~~~~~~~~~~~~
**Tutorial**: :ref:`customizing-test-collection`
Can be declared in *conftest.py files* to exclude test directories or modules
with Unix shell-style wildcards. Needs to be ``list[str]`` where ``str`` can
contain glob patterns.
.. code-block:: python
collect_ignore_glob = ["*_ignore.py"]
pytest_plugins
~~~~~~~~~~~~~~