From 0a7b8722e58fcebb5fdeb7b811c679cbae29dd92 Mon Sep 17 00:00:00 2001 From: Kevin C Date: Thu, 23 Jun 2022 17:54:51 -0700 Subject: [PATCH] Clarify writing_plugins naming instructions Fixes: #10072 --- AUTHORS | 1 + doc/en/how-to/writing_plugins.rst | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index d1f1b5503..9144f43be 100644 --- a/AUTHORS +++ b/AUTHORS @@ -187,6 +187,7 @@ Katarzyna Jachim Katarzyna Król Katerina Koukiou Keri Volans +Kevin C Kevin Cox Kevin J. Foley Kian Eliasi diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index 3e43d3252..2fbf49718 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -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 `. +:ref:`hooks `. Confirm registration with ``pytest --trace-config`` .. note::