From cf634ab3d07146a8117e8421f11b5f0671ae5222 Mon Sep 17 00:00:00 2001 From: OSC Contributor Date: Mon, 23 Mar 2026 02:33:36 +0800 Subject: [PATCH] fix: allow HIDDEN_PARAM in parametrize ids type annotation The parameter of currently has type , but should also accept (a sentinel). This fixes mypy errors when using . Fixes #14234 --- src/_pytest/mark/structures.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 0fa6e8babba..650e33765f7 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -532,7 +532,7 @@ def __call__( argvalues: Collection[ParameterSet | Sequence[object] | object], *, indirect: bool | Sequence[str] = ..., - ids: Iterable[None | str | float | int | bool] + ids: Iterable[None | str | float | int | bool | _HiddenParam] | Callable[[Any], object | None] | None = ..., scope: _ScopeName | None = ..., @@ -549,7 +549,7 @@ def __call__( argvalues: Iterable[ParameterSet | Sequence[object] | object], *, indirect: bool | Sequence[str] = ..., - ids: Iterable[None | str | float | int | bool] + ids: Iterable[None | str | float | int | bool | _HiddenParam] | Callable[[Any], object | None] | None = ..., scope: _ScopeName | None = ...,