-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Support per-request scope for fixtures #456
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
Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub): I think this is actually intended to work as you describe. The quick work around it just to build And I reckon the real issue here is probably a feature request: be able to have a scope which is called each time instead of once per test run. This reminds me of the scope discussions surrounding tmpdir where some people want a per-fixture directory and some people a per-test directory (and also has the problem of scope-mismatches). |
closing as unclear |
Not sure what's unclear about it - reopening because I might want to work at it at the sprint 😉 |
This is a feature. The nature of "fixtures" is that they are invariant by name. There is a slightly different concept of have a fixture-generator syntax, so that fixtures autovivify if referred to as a keyword. If keyword arguments were able to be used in this way, it would be possible to indicate that a fixture was intended to be a "new instance".
(I personally like the convention that assigning to names beginning with '_' means private/local) See: #2703 |
Originally reported by: BitBucket: brettatoms, GitHub: brettatoms
I'm not sure how to really describe this but here's a code sample that demonstrates the issue. Basically if I create a test that takes two fixtures as parameters and one of those fixtures depends on the other fixture then the fixture only gets called once and the test method has the same instance for both fixtures.
The text was updated successfully, but these errors were encountered: