@@ -202,7 +202,7 @@ Wrappers
202
202
A *hookimpl * can be marked with a ``"hookwrapper" `` option which indicates that
203
203
the function will be called to *wrap * (or surround) all other normal *hookimpl *
204
204
calls. A *hookwrapper * can thus execute some code ahead and after the execution
205
- of all corresponding non-hookwrappper *hookimpls *.
205
+ of all corresponding non-wrappper *hookimpls *.
206
206
207
207
Much in the same way as a `@contextlib.contextmanager `_, *hookwrappers * must
208
208
be implemented as generator function with a single ``yield `` in its body:
@@ -235,13 +235,15 @@ be implemented as generator function with a single ``yield`` in its body:
235
235
if config.use_defaults:
236
236
outcome.force_result(defaults)
237
237
238
- The generator is `sent `_ a :py:class: `pluggy._CallOutcome ` object which can
238
+ The generator is `sent `_ a :py:class: `pluggy._Result ` object which can
239
239
be assigned in the ``yield `` expression and used to override or inspect
240
- the final result(s) returned back to the hook caller.
240
+ the final result(s) returned back to the caller using the
241
+ :py:meth: `~pluggy._Result.force_result ` or
242
+ :py:meth: `~pluggy._Result.get_result ` methods.
241
243
242
244
.. note ::
243
245
Hook wrappers can **not ** return results (as per generator function
244
- semantics); they can only modify them using the ``_CallOutcome `` API.
246
+ semantics); they can only modify them using the ``_Result `` API.
245
247
246
248
Also see the `hookwrapper `_ section in the ``pytest `` docs.
247
249
@@ -599,7 +601,7 @@ Calling with a subset of registered plugins
599
601
-------------------------------------------
600
602
You can make a call using a subset of plugins by asking the
601
603
``PluginManager `` first for a ``_HookCaller `` with those plugins removed
602
- using the :py:meth: `pluggy.PluginManger .subset_hook_caller() ` method.
604
+ using the :py:meth: `pluggy.PluginManager .subset_hook_caller() ` method.
603
605
604
606
You then can use that ``_HookCaller `` to make normal, ``call_historic() ``,
605
607
or ``call_extra() `` calls as necessary.
0 commit comments