Open JulianFeinauer opened 2 years ago
Isn't this something like that?
Hmmmm... looks like that... RTFM again, hm? I will try to adopt my code : )
I was just looking for a place to document your new feature and found this that sounds like something very similar 😉
On March 21, 2022, GitHub @.***> wrote:
Hmmmm... looks like that... RTFM again, hm? Â I will try to adopt my code : )
— Reply to this email directly, view it on GitHub https://github.com/pytest-dev/pytest-django/issues/1001#issuecomment- 1073961182, or unsubscribe https://github.com/notifications/unsubscribe- auth/AA3LORGRVQTSBHP2FXQ3XZDVBCA4PANCNFSM5RHNN7VQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Feedback here...
It seems that it is at the moment impossible to run a custom database initialization when using pytest-django together with pytest-xdist.
The worker-nodes are then initialized differently and in the pytest_load_initial_conftests
Hook the "default" initialization is done for django.
So I think we have to stick to something like this approach
We use a setup where we do not use djangos "default" initialization but create our own settings via Djangos
settings.configure(xxx)
. Currently this is not supported via pytest-django but a very minor change could allow such a functionality.I think all that would be necessary is the possibility to call a callback before Line 351 (https://github.com/pytest-dev/pytest-django/blob/master/pytest_django/plugin.py#L351).
This change should not have any side effect for existing projects and by default the behavior of the library would not be changed at all.
I will provide a suggestion in the next days for a MWE.