Merge pull request #10988 from nicoddemus/initial-testpaths-10987 (#10995)

Consider testpaths for initial conftests

(cherry picked from commit 76d15231f5)
This commit is contained in:
Bruno Oliveira
2023-05-12 10:42:27 -03:00
committed by GitHub
parent 25ebf53f72
commit 8082d27d11
6 changed files with 75 additions and 11 deletions
+14 -6
View File
@@ -1713,13 +1713,12 @@ passed multiple times. The expected format is ``name=value``. For example::
.. confval:: testpaths
Sets list of directories that should be searched for tests when
no specific directories, files or test ids are given in the command line when
executing pytest from the :ref:`rootdir <rootdir>` directory.
File system paths may use shell-style wildcards, including the recursive
``**`` pattern.
Useful when all project tests are in a known location to speed up
test collection and to avoid picking up undesired tests by accident.
@@ -1728,8 +1727,17 @@ passed multiple times. The expected format is ``name=value``. For example::
[pytest]
testpaths = testing doc
This tells pytest to only look for tests in ``testing`` and ``doc``
directories when executing from the root directory.
This configuration means that executing:
.. code-block:: console
pytest
has the same practical effects as executing:
.. code-block:: console
pytest testing doc
.. confval:: tmp_path_retention_count
@@ -1744,7 +1752,7 @@ passed multiple times. The expected format is ``name=value``. For example::
[pytest]
tmp_path_retention_count = 3
Default: 3
Default: ``3``
.. confval:: tmp_path_retention_policy
@@ -1763,7 +1771,7 @@ passed multiple times. The expected format is ``name=value``. For example::
[pytest]
tmp_path_retention_policy = "all"
Default: all
Default: ``all``
.. confval:: usefixtures