From 895164c56dcbe0126fa6c413f70c803e9ed81449 Mon Sep 17 00:00:00 2001 From: Nipunn Koorapati Date: Wed, 13 Jul 2022 18:13:22 -0700 Subject: [PATCH] Add typing for FixtureRequest.param For now, mark it as Any until #8073 is solved Fixes #9514 --- AUTHORS | 1 + changelog/9514.bugfix.rst | 1 + src/_pytest/fixtures.py | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/9514.bugfix.rst diff --git a/AUTHORS b/AUTHORS index 09fe12e004f..b0669ba29fd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -252,6 +252,7 @@ Nicholas Murphy Niclas Olofsson Nicolas Delaby Nikolay Kondratyev +Nipunn Koorapati Olga Matoula Oleg Pidsadnyi Oleg Sushchenko diff --git a/changelog/9514.bugfix.rst b/changelog/9514.bugfix.rst new file mode 100644 index 00000000000..d4b2280effb --- /dev/null +++ b/changelog/9514.bugfix.rst @@ -0,0 +1 @@ +Type FixtureRequest.param as Any. diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 32c3ec4b0bf..4975be8203d 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -345,7 +345,7 @@ def reorder_items_atscope( return items_done -def get_direct_param_fixture_func(request): +def get_direct_param_fixture_func(request: "FixtureRequest") -> Any: return request.param @@ -407,6 +407,7 @@ def __init__(self, pyfuncitem, *, _ispytest: bool = False) -> None: self._arg2fixturedefs = fixtureinfo.name2fixturedefs.copy() self._arg2index: Dict[str, int] = {} self._fixturemanager: FixtureManager = pyfuncitem.session._fixturemanager + self.param: Any @property def scope(self) -> "_ScopeName":