Skip to content

Commit 66d8063

Browse files
Fix benchmark.py to use ProjectSpec for hook config extraction
Update the benchmark file to use the new ProjectSpec.get_hookimpl_config() method instead of the removed HookimplMarker.get_hookconfig() method. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent abb2f64 commit 66d8063

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

testing/benchmark.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
import pytest
88

9-
from pluggy import HookimplMarker
10-
from pluggy import HookspecMarker
119
from pluggy import PluginManager
10+
from pluggy import ProjectSpec
1211
from pluggy._callers import _multicall
1312
from pluggy._hooks import HookImpl
1413

1514

16-
hookspec = HookspecMarker("example")
17-
hookimpl = HookimplMarker("example")
15+
project_spec = ProjectSpec("example")
16+
hookspec = project_spec.hookspec
17+
hookimpl = project_spec.hookimpl
1818

1919

2020
@hookimpl
@@ -42,11 +42,13 @@ def setup():
4242
hook_name = "foo"
4343
hook_impls = []
4444
for method in hooks + wrappers:
45+
config = project_spec.get_hookimpl_config(method)
46+
assert config is not None # Benchmark functions should be decorated
4547
f = HookImpl(
4648
None,
4749
"<temp>",
4850
method,
49-
hookimpl.get_hookconfig(method),
51+
config,
5052
)
5153
hook_impls.append(f)
5254
caller_kwargs = {"arg1": 1, "arg2": 2, "arg3": 3}

0 commit comments

Comments
 (0)