-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
typing: Improve FixtureDefinition and FixtureDef #13036
base: main
Are you sure you want to change the base?
Conversation
cc @Glyphack |
* Carry around parameters and return value in `FixtureFunctionDefinition`. * Add `FixtureParams` to `FixtureDef`. Follow up to pytest-dev#12473.
ec71fce
to
0303285
Compare
Hmmm turns out https://github.com/search?q=repo%3Apytest-dev%2Fpytest-bdd%20FixtureDef&type=code The new |
Is the |
I don't think so. Should I try to keep only the change to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paramspec types give me a slight headache as we basically resolve them internally and I wonder if there's a good way to make them work in passover
src/_pytest/python.py
Outdated
@@ -1085,7 +1085,7 @@ def get_direct_param_fixture_func(request: FixtureRequest) -> Any: | |||
|
|||
|
|||
# Used for storing pseudo fixturedefs for direct parametrization. | |||
name2pseudofixturedef_key = StashKey[dict[str, FixtureDef[Any]]]() | |||
name2pseudofixturedef_key = StashKey[dict[str, FixtureDef[Any, Any]]]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm starting to get the impression we need a type alias for those dicts as they land in too many places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
Done. |
f002e4a
to
889d9b8
Compare
889d9b8
to
348068c
Compare
TBH I'm second guessing if this is useful at all. In the end we cannot do proper type checking because we need to keep all the |
I agree for |
FixtureFunctionDefinition
.FixtureParams
toFixtureDef
.Follow up to #12473.