Merge pull request #10073 from Kache/main
Clarify writing_plugins naming instructions
This commit is contained in:
commit
d2a206683c
1
AUTHORS
1
AUTHORS
|
@ -187,6 +187,7 @@ Katarzyna Jachim
|
|||
Katarzyna Król
|
||||
Katerina Koukiou
|
||||
Keri Volans
|
||||
Kevin C
|
||||
Kevin Cox
|
||||
Kevin J. Foley
|
||||
Kian Eliasi
|
||||
|
|
|
@ -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::
|
||||
|
||||
|
|
Loading…
Reference in New Issue