Clarify writing_plugins naming instructions

Fixes: #10072
This commit is contained in:
Kevin C 2022-06-23 17:54:51 -07:00
parent 141c5e5a89
commit 0a7b8722e5
2 changed files with 5 additions and 2 deletions

View File

@ -187,6 +187,7 @@ Katarzyna Jachim
Katarzyna Król
Katerina Koukiou
Keri Volans
Kevin C
Kevin Cox
Kevin J. Foley
Kian Eliasi

View File

@ -158,18 +158,20 @@ it in your setuptools-invocation:
# sample ./setup.py file
from setuptools import setup
name_of_plugin = "myproject" # register plugin with this name
setup(
name="myproject",
packages=["myproject"],
# the following makes a plugin available to pytest
entry_points={"pytest11": ["name_of_plugin = myproject.pluginmodule"]},
entry_points={"pytest11": [f"{name_of_plugin} = myproject.pluginmodule"]},
# custom PyPI classifier for pytest plugins
classifiers=["Framework :: Pytest"],
)
If a package is installed this way, ``pytest`` will load
``myproject.pluginmodule`` as a plugin which can define
:ref:`hooks <hook-reference>`.
:ref:`hooks <hook-reference>`. Confirm registration with ``pytest --trace-config``
.. note::