-
Notifications
You must be signed in to change notification settings - Fork 23
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
doesn't work well with pytest-django settings #3
Comments
@fletom have you figured a way around this? The issue is being discussed here without a resolution so far |
sorry, I couldn't find a nice way to do it so I ended up doing what I wanted without an environment variable at all |
After reading pytest-dev/pytest#935 and https://docs.pytest.org/en/latest/writing_plugins.html#hook-function-ordering-call-example, I tried something very simple: I added I'll send a PR as soon as possible. |
This is required when other plugins (e.g. pytest-django) need to access environment variables set by this plugin. Fixes MobileDynasty#3.
Thanks for the report, @Schnouki - I run into this as well. It would be cool, if the PR can be merged :) |
Another problem came up regarding the STAGE=test flag, so that py.test runs with Whitenoise. py.test environments are not loaded before django settings setup (check MobileDynasty/pytest-env#3). The pytest-env needs to be fixed but a PR is not accepted, I forked the repository and used that one.
pytest-django's
pytest_load_initial_conftests
method, which imports the Django settings file, runs before pytest-env'spytest_load_initial_conftests
that means that any environment variables which are used in the Django settings module will not be set from pytest-env
is there any way to make sure that pytest-env runs first?
The text was updated successfully, but these errors were encountered: