Skip to content

Commit 85393c6

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 732d405 commit 85393c6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pytest_django/plugin.py

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

175175
# Configure DJANGO_SETTINGS_MODULE
176176
ds = (options.ds or
177-
early_config.getini(SETTINGS_MODULE_ENV) or
178-
os.environ.get(SETTINGS_MODULE_ENV))
177+
os.environ.get(SETTINGS_MODULE_ENV) or
178+
early_config.getini(SETTINGS_MODULE_ENV))
179179

180180
# Configure DJANGO_CONFIGURATION
181181
dc = (options.dc or
182-
early_config.getini(CONFIGURATION_ENV) or
183-
os.environ.get(CONFIGURATION_ENV))
182+
os.environ.get(CONFIGURATION_ENV) or
183+
early_config.getini(CONFIGURATION_ENV))
184184

185185
if ds:
186186
os.environ[SETTINGS_MODULE_ENV] = ds

0 commit comments

Comments
 (0)