Merge pull request #10073 from Kache/main

Clarify writing_plugins naming instructions
This commit is contained in:
Zac Hatfield-Dodds 2022-06-24 23:27:58 -07:00 committed by GitHub
commit d2a206683c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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::