-
-
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 #12999
typing: Improve FixtureDefinition and FixtureDef #12999
Conversation
This is an internal class users don't need to know about it.
for more information, see https://pre-commit.ci
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
for more information, see https://pre-commit.ci
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
@nicoddemus can you open a pr against the branch @Glyphack has from your branch and link it, so the change can be seen in relation to his pr |
@RonnyPfannschmidt this is not really ready to review or merge, I only wanted to open the PR to make sure I did not lose my local commits, hehehe. |
@@ -124,7 +130,7 @@ def pytest_sessionstart(session: Session) -> None: | |||
|
|||
def get_scope_package( | |||
node: nodes.Item, | |||
fixturedef: FixtureDef[object], | |||
fixturedef: FixtureDef[Any, object], |
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.
what does Any represent here?
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.
It's for filling the new generic parameter for the arguments
if inspect.isclass(function): | ||
raise ValueError("class fixtures not supported (maybe in the future)") | ||
|
||
if getattr(function, "_pytestfixturefunction", False): | ||
if isinstance(function, FixtureFunctionDefinition): | ||
raise ValueError( |
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.
in which cases this error could be raised?
Superseded by #13036. |
Follow up to #12473, built on top of it, not ready to merge.