typing: Improve FixtureDefinition and FixtureDef#13036
typing: Improve FixtureDefinition and FixtureDef#13036nicoddemus wants to merge 4 commits intopytest-dev:mainfrom
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.
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.
I'm starting to get the impression we need a type alias for those dicts as they land in too many places
|
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.