Skip to content

Commit 038ca82

Browse files
committed
Look at os.environ before early_config
This breaks a lot of internal tests, which could be adjusted. I think it makes more sense to prefer the current environment before the config from (e.g.) setup.cfg.
1 parent 0ec741b commit 038ca82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pytest_django/plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ def pytest_load_initial_conftests(early_config, parser, args):
172172

173173
# Configure DJANGO_SETTINGS_MODULE
174174
ds = (options.ds or
175-
early_config.getini(SETTINGS_MODULE_ENV) or
176-
os.environ.get(SETTINGS_MODULE_ENV))
175+
os.environ.get(SETTINGS_MODULE_ENV) or
176+
early_config.getini(SETTINGS_MODULE_ENV))
177177

178178
# Configure DJANGO_CONFIGURATION
179179
dc = (options.dc or
180-
early_config.getini(CONFIGURATION_ENV) or
181-
os.environ.get(CONFIGURATION_ENV))
180+
os.environ.get(CONFIGURATION_ENV) or
181+
early_config.getini(CONFIGURATION_ENV))
182182

183183
if ds:
184184
os.environ[SETTINGS_MODULE_ENV] = ds

0 commit comments

Comments
 (0)