Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/pytest_codspeed/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
from . import __version__

if TYPE_CHECKING:
from typing import Any, Callable, TypeVar
from typing import Any, Callable, ParamSpec, TypeVar

from pytest_codspeed.instruments import Instrument

T = TypeVar("T")
P = ParamSpec("P")


@pytest.hookimpl(trylast=True)
Expand Down Expand Up @@ -328,9 +329,7 @@ def __init__(self, request: pytest.FixtureRequest):
self._plugin = get_plugin(self._config)
self._called = False

def __call__(
self, target: Callable[..., T], *args: tuple, **kwargs: dict[str, Any]
) -> T:
def __call__(self, target: Callable[P, T], *args: P.args, **kwargs: P.kwargs) -> T:
if self._called:
raise RuntimeError("The benchmark fixture can only be used once per test")
self._called = True
Expand Down