-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
typing: Improve FixtureDefinition and FixtureDef #13036
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
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 |
RonnyPfannschmidt
left a comment
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
|
|
||
| # 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 |
|
Unfortunately I won't have time to continue this, so I will be closing given is a "nice to have" feature. If anybody wants to continue from this point please be my guest! |
FixtureFunctionDefinition.FixtureParamstoFixtureDef.Follow up to #12473.