From a1ad6e31173b0e26dc68c5e90ce524ed209da312 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 5 Mar 2020 05:55:04 +0100 Subject: [PATCH] doc: fix/revisit _Result (hook wrappers) - it should not document the deprecated `result`; used the same as pluggy documents itself - add a "hookwrapper" label, that could be used by pluggy (currently it links to the section) - use pluggy's `hookwrappers` label for linking to its documentation --- doc/en/reference.rst | 5 ++++- doc/en/writing_plugins.rst | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 16bf3cf79..b746172ea 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -886,8 +886,11 @@ TestReport _Result ~~~~~~~ +Result used within :ref:`hook wrappers `. + .. autoclass:: pluggy.callers._Result - :members: +.. automethod:: pluggy.callers._Result.get_result +.. automethod:: pluggy.callers._Result.force_result Special Variables ----------------- diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index e914af401..f590a1245 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -508,6 +508,7 @@ call only executes until the first of N registered functions returns a non-None result which is then taken as result of the overall hook call. The remaining hook functions will not be called in this case. +.. _`hookwrapper`: hookwrapper: executing around other hooks ------------------------------------------------- @@ -552,7 +553,8 @@ perform tracing or other side effects around the actual hook implementations. If the result of the underlying hook is a mutable object, they may modify that result but it's probably better to avoid it. -For more information, consult the `pluggy documentation `_. +For more information, consult the +:ref:`pluggy documentation about hookwrappers `. Hook function ordering / call example