Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typing for FixtureRequest.param #10133

Merged
merged 3 commits into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ Nicholas Murphy
Niclas Olofsson
Nicolas Delaby
Nikolay Kondratyev
Nipunn Koorapati
Olga Matoula
Oleg Pidsadnyi
Oleg Sushchenko
Expand Down
1 change: 1 addition & 0 deletions changelog/9514.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Type FixtureRequest.param as Any.
nipunn1313 marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion src/_pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
nipunn1313 marked this conversation as resolved.
Show resolved Hide resolved

@property
def scope(self) -> "_ScopeName":
Expand Down