-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Per-use fixture scope #2833
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
Comments
I'm personally -1 on this, I think the factory option is good enough to implement and understand. Adding it as yet another fixture flavor option to pytest would only bring more complexity for little benefit, IMHO. |
a however as of now this cant be sanely implemented |
Possible dupe: #456 Another data point: using a factory prevents pretty-parameter failure output.
|
Ref: #2703 |
Duplicate of #456 I believe, if not feel free to reopen (let's consolidate discussion on this there) |
I often find myself needing 2 results from a function-scoped fixture for the same test run.
To do this today, I need a factory:
Alternatively, I can invoke
foo
directly (like a regular function), but then everythingfoo
accepts (i.e.a
,b
,c
,d
) must be defined in the calling scope which is unscalable.If there was, say, a
'call'
scope, this could be replaced with:bar
andbaz
get distinctfoo
s.In other words, this is a feature request for a fixture scope that behaves just like regular function invocations, but you don't have to do the invocation,
pytest
does it for you (which keeps the calling scope uncluttered).The text was updated successfully, but these errors were encountered: