From 8c74bb0d25e7fbff970d7a53989ad1a83b3843fc Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 3 Dec 2015 01:01:34 -0200 Subject: [PATCH] Improve description on how pytest starts test collection in goodpractises --- doc/en/customize.rst | 2 +- doc/en/goodpractises.rst | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/en/customize.rst b/doc/en/customize.rst index 1c1655697..34e319c24 100644 --- a/doc/en/customize.rst +++ b/doc/en/customize.rst @@ -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 ` 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. diff --git a/doc/en/goodpractises.rst b/doc/en/goodpractises.rst index ae93e0c2a..b2c34bae9 100644 --- a/doc/en/goodpractises.rst +++ b/doc/en/goodpractises.rst @@ -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)