You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have an upstream which triggers the behaviour described in pytest-dev/pytest#2825 and #499 - they set a constant from a DB query which occurs during import.
I see some comments describing how to defer the query election (in https://stackoverflow.com/questions/43326132/how-to-avoid-import-time-database-access-in-django ) such as https://github.com/ionelmc/python-lazy-object-proxy, but is there a documented best practice on how to defer DB queries so they don't occur during import?
While reading pytest-django/issues/499 @pelme asserts that "Doing database queries at import time comes with a number of problems and should be avoided. Even if your code happens to work in your particular case, supporting this pattern in pytest-django is not feasible." but I can't find any supporting documentation for that assertion either.
Is there a page (or pages) which I can refer upstreams to which answer those questions?
The text was updated successfully, but these errors were encountered:
Hi, I have an upstream which triggers the behaviour described in pytest-dev/pytest#2825 and #499 - they set a constant from a DB query which occurs during import.
I see some comments describing how to defer the query election (in https://stackoverflow.com/questions/43326132/how-to-avoid-import-time-database-access-in-django ) such as https://github.com/ionelmc/python-lazy-object-proxy, but is there a documented best practice on how to defer DB queries so they don't occur during import?
While reading pytest-django/issues/499 @pelme asserts that "Doing database queries at import time comes with a number of problems and should be avoided. Even if your code happens to work in your particular case, supporting this pattern in pytest-django is not feasible." but I can't find any supporting documentation for that assertion either.
Is there a page (or pages) which I can refer upstreams to which answer those questions?
The text was updated successfully, but these errors were encountered: