From 62c24880588eb508a5b9c79525945d2aaf7adc42 Mon Sep 17 00:00:00 2001 From: Leeds9z Date: Fri, 24 Nov 2023 11:03:01 -0500 Subject: [PATCH 1/2] docs changes about limitations with hook function ordering --- doc/en/how-to/writing_hook_functions.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/en/how-to/writing_hook_functions.rst b/doc/en/how-to/writing_hook_functions.rst index 527aeec81..1c15ecc3a 100644 --- a/doc/en/how-to/writing_hook_functions.rst +++ b/doc/en/how-to/writing_hook_functions.rst @@ -117,6 +117,10 @@ Hook function ordering / call example For any given hook specification there may be more than one implementation and we thus generally view ``hook`` execution as a ``1:N`` function call where ``N`` is the number of registered functions. + +There are certain limitations about hooks starting with ``_pytest``. For +more information, consult :ref:`Declaring new hooks `. + There are ways to influence if a hook implementation comes before or after others, i.e. the position in the ``N``-sized list of functions: @@ -165,6 +169,7 @@ Here is the order of execution: It's possible to use ``tryfirst`` and ``trylast`` also on hook wrappers in which case it will influence the ordering of hook wrappers among each other. +.. _`new-hooks`: Declaring new hooks ------------------------ From 19b38bee9441d41e0376c73be80c1a60c6b3864f Mon Sep 17 00:00:00 2001 From: Leeds9z Date: Sun, 3 Dec 2023 15:21:48 -0500 Subject: [PATCH 2/2] changed _pytest to pytest_ --- doc/en/how-to/writing_hook_functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/how-to/writing_hook_functions.rst b/doc/en/how-to/writing_hook_functions.rst index 1c15ecc3a..f80d100bf 100644 --- a/doc/en/how-to/writing_hook_functions.rst +++ b/doc/en/how-to/writing_hook_functions.rst @@ -118,7 +118,7 @@ For any given hook specification there may be more than one implementation and we thus generally view ``hook`` execution as a ``1:N`` function call where ``N`` is the number of registered functions. -There are certain limitations about hooks starting with ``_pytest``. For +There are certain limitations about hooks starting with ``pytest_``. For more information, consult :ref:`Declaring new hooks `. There are ways to influence if a hook implementation comes before or