-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Description
Current the ids keyword argument of pytest.mark.parametrize is an Iterable[None | str | float | int | bool]. It should also allow pytest.HIDDEN_PARAM (similar to pytest.param(id=...)).
$ pip list
Package Version Editable project location
----------------- ----------------------- -------------------------
iniconfig 2.3.0
librt 0.8.1
mypy 1.19.1
mypy_extensions 1.1.0
packaging 26.0
pathspec 1.0.4
pip 24.0
pluggy 1.6.0
Pygments 2.19.2
pytest 9.1.0.dev216+g9fd1eebd8 /home/user/pytest
typing_extensions 4.15.0
$ pytest --version
pytest 9.1.0.dev216+g9fd1eebd8
$ cat example.py
from __future__ import annotations
import pytest
@pytest.mark.parametrize("a", [1], ids=[pytest.HIDDEN_PARAM])
def test_a(a: int) -> None:
assert a == 1
$ mypy example.py
example.py:6: error: List item 0 has incompatible type "_HiddenParam"; expected "str | float | int | None" [list-item]
Found 1 error in 1 file (checked 1 source file)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels