From 1876a928d3dfc038cf25550385acb19cef69a188 Mon Sep 17 00:00:00 2001 From: Christian Fetzer Date: Wed, 6 Feb 2019 17:15:28 +0100 Subject: [PATCH] Document collect_ignore and collect_ignore_glob in reference --- doc/en/reference.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 92e298a88..c1e22f854 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -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 ~~~~~~~~~~~~~~