File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed
Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,6 @@ The remaining hook functions will not be called in this case.
5959hook wrappers: executing around other hooks
6060-------------------------------------------------
6161
62- .. currentmodule :: _pytest.core
63-
64-
65-
6662pytest plugins can implement hook wrappers which wrap the execution
6763of other hook implementations. A hook wrapper is a generator function
6864which yields exactly once. When pytest invokes hooks it first executes
@@ -165,6 +161,7 @@ Here is the order of execution:
165161It's possible to use ``tryfirst `` and ``trylast `` also on hook wrappers
166162in which case it will influence the ordering of hook wrappers among each other.
167163
164+ .. _`declaringhooks` :
168165
169166Declaring new hooks
170167------------------------
Original file line number Diff line number Diff line change @@ -612,10 +612,30 @@ Hooks
612612
613613**Tutorial **: :ref: `writing-plugins `
614614
615- .. currentmodule :: _pytest.hookspec
616-
617615Reference to all hooks which can be implemented by :ref: `conftest.py files <localplugin >` and :ref: `plugins <plugins >`.
618616
617+ @pytest.hookimpl
618+ ~~~~~~~~~~~~~~~~
619+
620+ .. function :: pytest.hookimpl
621+ :decorator:
622+
623+ pytest's decorator for marking functions as hook implementations.
624+
625+ See :ref: `writinghooks ` and :func: `pluggy.HookimplMarker `.
626+
627+ @pytest.hookspec
628+ ~~~~~~~~~~~~~~~~
629+
630+ .. function :: pytest.hookspec
631+ :decorator:
632+
633+ pytest's decorator for marking functions as hook specifications.
634+
635+ See :ref: `declaringhooks ` and :func: `pluggy.HookspecMarker `.
636+
637+ .. currentmodule :: _pytest.hookspec
638+
619639Bootstrapping hooks
620640~~~~~~~~~~~~~~~~~~~
621641
You can’t perform that action at this time.
0 commit comments