Merge pull request #4097 from asottile/improve_doc_plugin_load

Fix formatting for plugin loading in conftest
This commit is contained in:
Anthony Sottile 2018-10-09 10:23:04 -07:00 committed by GitHub
commit b8c30aab2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -69,17 +69,15 @@ You may also discover more plugins through a `pytest- pypi.python.org search`_.
Requiring/Loading plugins in a test module or conftest file Requiring/Loading plugins in a test module or conftest file
----------------------------------------------------------- -----------------------------------------------------------
You can require plugins in a test module or a conftest file like this:: You can require plugins in a test module or a conftest file like this:
pytest_plugins = "myapp.testsupport.myplugin", .. code-block:: python
pytest_plugins = ("myapp.testsupport.myplugin",)
When the test module or conftest plugin is loaded the specified plugins When the test module or conftest plugin is loaded the specified plugins
will be loaded as well. will be loaded as well.
pytest_plugins = "myapp.testsupport.myplugin"
which will import the specified module as a ``pytest`` plugin.
.. note:: .. note::
Requiring plugins using a ``pytest_plugins`` variable in non-root Requiring plugins using a ``pytest_plugins`` variable in non-root
``conftest.py`` files is deprecated. See ``conftest.py`` files is deprecated. See