File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 69
69
70
70
__version__ = '0.2.0'
71
71
__all__ = ["PluginManager" , "PluginValidationError" ,
72
- "HookspecDecorator " , "HookimplDecorator " ]
72
+ "HookspecMarker " , "HookimplMarker " ]
73
73
74
74
_py3 = sys .version_info > (3 , 0 )
75
75
76
76
77
- class HookspecDecorator :
77
+ class HookspecMarker :
78
78
""" Decorator helper class for marking functions as hook specifications.
79
79
80
- You can instantiate it to get a decorator.
81
-
80
+ You can instantiate it with a project_name to get a decorator.
81
+ Calling PluginManager.add_hookspecs later will discover all marked functions
82
+ if the PluginManager uses the same project_name.
82
83
"""
83
84
84
85
def __init__ (self , project_name ):
@@ -111,10 +112,12 @@ def setattr_hookspec_opts(func):
111
112
return setattr_hookspec_opts
112
113
113
114
114
- class HookimplDecorator :
115
+ class HookimplMarker :
115
116
""" Decorator helper class for marking functions as hook implementations.
116
117
117
- You can instantiate it to get a decorator.
118
+ You can instantiate with a project_name to get a decorator.
119
+ Calling PluginManager.register later will discover all marked functions
120
+ if the PluginManager uses the same project_name.
118
121
119
122
"""
120
123
def __init__ (self , project_name ):
Original file line number Diff line number Diff line change 4
4
import pytest
5
5
6
6
from pluggy import (PluginManager , varnames , PluginValidationError ,
7
- HookimplDecorator , HookspecDecorator )
7
+ HookimplMarker , HookspecMarker )
8
8
9
9
from pluggy import (_MultiCall , _TagTracer , _HookImpl )
10
10
11
- hookspec = HookspecDecorator ("example" )
12
- hookimpl = HookimplDecorator ("example" )
11
+ hookspec = HookspecMarker ("example" )
12
+ hookimpl = HookimplMarker ("example" )
13
13
14
14
15
15
@pytest .fixture
You can’t perform that action at this time.
0 commit comments