diff --git a/changelog/14465.doc.rst b/changelog/14465.doc.rst new file mode 100644 index 00000000000..2c950292911 --- /dev/null +++ b/changelog/14465.doc.rst @@ -0,0 +1 @@ +Updated the hooks how-to page to link the ``newhooks.py`` file in ``pytest-xdist`` at tag ``v3.8.0`` instead of an unrelated 2017-era commit under the old layout. Pointing at a tag keeps the example in sync with the version users actually install, while remaining stable when the project's main branch moves on. diff --git a/doc/en/how-to/writing_hook_functions.rst b/doc/en/how-to/writing_hook_functions.rst index d5d6d2ae4f7..bdf6a0fdc85 100644 --- a/doc/en/how-to/writing_hook_functions.rst +++ b/doc/en/how-to/writing_hook_functions.rst @@ -205,7 +205,7 @@ class or module can then be passed to the ``pluginmanager`` using the ``pytest_a For a real world example, see `newhooks.py`_ from `xdist `_. -.. _`newhooks.py`: https://github.com/pytest-dev/pytest-xdist/blob/974bd566c599dc6a9ea291838c6f226197208b46/xdist/newhooks.py +.. _`newhooks.py`: https://github.com/pytest-dev/pytest-xdist/blob/v3.8.0/src/xdist/newhooks.py Hooks may be called both from fixtures or from other hooks. In both cases, hooks are called through the ``hook`` object, available in the ``config`` object. Most hooks receive a