-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Support usefixtures with parametrize #11298
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Support use `pytest.mark.usefixtures` with `pytest.mark.parametrize`. | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,6 +163,7 @@ def getfuncargnames( | |
and not isinstance( | ||
inspect.getattr_static(cls, name, default=None), staticmethod | ||
) | ||
and not hasattr(function, "__self__") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Parameterized tests are bound to an instance of the test class. And in their signature there is no longer a parameter for an instance of this class ('self'). |
||
): | ||
arg_names = arg_names[1:] | ||
# Remove any names that will be replaced with mocks. | ||
|
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.
An example would be cool here I think. Also mentioning this technique in the docs somewhere would be good.