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

typing: Improve FixtureDefinition and FixtureDef #12999

Closed

Conversation

nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Nov 26, 2024

Follow up to #12473, built on top of it, not ready to merge.

Glyphack and others added 30 commits November 23, 2024 16:20
This is an internal class users don't need to know about it.
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Nov 26, 2024
@RonnyPfannschmidt
Copy link
Member

@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

@nicoddemus
Copy link
Member Author

@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],
Copy link

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?

Copy link
Member

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(
Copy link

@Tusenka Tusenka Dec 4, 2024

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?

@nicoddemus
Copy link
Member Author

Superseded by #13036.

@nicoddemus nicoddemus closed this Dec 7, 2024
@nicoddemus nicoddemus deleted the Glyphack/reprs-assert-callable branch December 7, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided (automation) changelog entry is part of PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants