From 06ff52ac7d2ca006604bf4b60021e73480ae2e8a Mon Sep 17 00:00:00 2001 From: Arya Rizky Date: Wed, 13 May 2026 07:55:22 +0700 Subject: [PATCH] fix: update xdist newhooks.py link in hooks how-to docs The link in docs for declaring new hooks pointed to an old xdist commit that predates the src layout migration. Update it to point to the current master branch with the correct src/xdist/newhooks.py path. Closes #14465 --- changelog/14465.doc.rst | 1 + doc/en/how-to/writing_hook_functions.rst | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/14465.doc.rst diff --git a/changelog/14465.doc.rst b/changelog/14465.doc.rst new file mode 100644 index 00000000000..5641d0428ca --- /dev/null +++ b/changelog/14465.doc.rst @@ -0,0 +1 @@ +Updated the xdist ``newhooks.py`` link in the hooks how-to documentation to point to the current ``master`` branch with the updated ``src`` layout. diff --git a/doc/en/how-to/writing_hook_functions.rst b/doc/en/how-to/writing_hook_functions.rst index d5d6d2ae4f7..e08570a0054 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/master/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