-
-
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
Rescope a fixture #3377
Comments
Unfortunately I don't think there's any easy solution to this; if your django application does not hold state, perhaps you can change it into a |
Thanks, that answers my question. For the record, I've mixed things up a bit when simplifying my example; |
@timdiels thanks for the follow up. Can we close this? |
Yes |
I'd like to change the scope of a fixture within a class, e.g.
gets the response again for each test function, but this is more isolation than I need as my tests don't modify the response. I'd like response to be class scoped to improve performance, but django_app is function scoped. The only way of changing the scope that I can think of is copy pasting the response fixture, and recursively all of its dependencies to change the scope:
This also assumes the function scoped django_app is not set up in case it would interfere; it's not needed by these tests, but it is used by other tests outside of this class. The alternative is to simply merge all tests into 1, but I'd rather avoid that.
Is there perhaps some juicy feature I'm overlooking?
The text was updated successfully, but these errors were encountered: