Improve description on how pytest starts test collection in goodpractises
This commit is contained in:
parent
bb4771cedf
commit
8c74bb0d25
|
@ -162,7 +162,7 @@ Builtin configuration file options
|
|||
.. versionadded:: 2.8
|
||||
|
||||
Sets list of directories that should be searched for tests when
|
||||
no specific directories or files are given in the command line when
|
||||
no specific directories, files or test ids are given in the command line when
|
||||
executing pytest from the :ref:`rootdir <rootdir>` directory.
|
||||
Useful when all project tests are in a known location to speed up
|
||||
test collection and to avoid picking up undesired tests by accident.
|
||||
|
|
|
@ -13,11 +13,9 @@ Conventions for Python test discovery
|
|||
|
||||
``pytest`` implements the following standard test discovery:
|
||||
|
||||
* collection starts from paths specified in :confval:`testpaths` if configured,
|
||||
otherwise from initial command line arguments which may be directories,
|
||||
filenames or test ids. If :confval:`testpaths` is not configured and no
|
||||
directories or files were given in the command line, start collection from
|
||||
the current directory.
|
||||
* If no arguments are specified then collection starts from :confval:`testpaths`
|
||||
(if configured) or the current directory. Alternatively, command line arguments
|
||||
can be used in any combination of directories, file names or node ids.
|
||||
* recurse into directories, unless they match :confval:`norecursedirs`
|
||||
* ``test_*.py`` or ``*_test.py`` files, imported by their `test package name`_.
|
||||
* ``Test`` prefixed test classes (without an ``__init__`` method)
|
||||
|
|
Loading…
Reference in New Issue