@@ -33,26 +33,34 @@ Plugin discovery order at tool startup
33
33
34
34
``pytest `` loads plugin modules at tool startup in the following way:
35
35
36
- * by loading all builtin plugins
36
+ 1. by scanning the command line for the ``-p no:name `` option
37
+ and *blocking * that plugin from being loaded (even builtin plugins can
38
+ be blocked this way). This happens before normal command-line parsing.
37
39
38
- * by loading all plugins registered through ` setuptools entry points `_ .
40
+ 2. by loading all builtin plugins .
39
41
40
- * by pre- scanning the command line for the ``-p name `` option
41
- and loading the specified plugin before actual command line parsing.
42
+ 3. by scanning the command line for the ``-p name `` option
43
+ and loading the specified plugin. This happens before normal command- line parsing.
42
44
43
- * by loading all :file: `conftest.py ` files as inferred by the command line
44
- invocation:
45
+ 4. by loading all plugins registered through `setuptools entry points `_.
45
46
46
- - if no test paths are specified use current dir as a test path
47
- - if exists, load ``conftest.py `` and ``test*/conftest.py `` relative
48
- to the directory part of the first test path.
47
+ 5. by loading all plugins specified through the :envvar: `PYTEST_PLUGINS ` environment variable.
49
48
50
- Note that pytest does not find ``conftest.py `` files in deeper nested
51
- sub directories at tool startup. It is usually a good idea to keep
52
- your ``conftest.py `` file in the top level test or project root directory.
49
+ 6. by loading all :file: `conftest.py ` files as inferred by the command line
50
+ invocation:
53
51
54
- * by recursively loading all plugins specified by the
55
- :globalvar: `pytest_plugins ` variable in ``conftest.py `` files
52
+ - if no test paths are specified, use the current dir as a test path
53
+ - if exists, load ``conftest.py `` and ``test*/conftest.py `` relative
54
+ to the directory part of the first test path. After the ``conftest.py ``
55
+ file is loaded, load all plugins specified in its
56
+ :globalvar: `pytest_plugins ` variable if present.
57
+
58
+ Note that pytest does not find ``conftest.py `` files in deeper nested
59
+ sub directories at tool startup. It is usually a good idea to keep
60
+ your ``conftest.py `` file in the top level test or project root directory.
61
+
62
+ 7. by recursively loading all plugins specified by the
63
+ :globalvar: `pytest_plugins ` variable in ``conftest.py `` files.
56
64
57
65
58
66
.. _`pytest/plugin` : http://bitbucket.org/pytest-dev/pytest/src/tip/pytest/plugin/
0 commit comments