Skip to content

Commit

Permalink
Look at os.environ before early_config
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
blueyed committed Mar 29, 2015
1 parent 0ec741b commit 038ca82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ def pytest_load_initial_conftests(early_config, parser, args):

# Configure DJANGO_SETTINGS_MODULE
ds = (options.ds or
early_config.getini(SETTINGS_MODULE_ENV) or
os.environ.get(SETTINGS_MODULE_ENV))
os.environ.get(SETTINGS_MODULE_ENV) or
early_config.getini(SETTINGS_MODULE_ENV))

# Configure DJANGO_CONFIGURATION
dc = (options.dc or
early_config.getini(CONFIGURATION_ENV) or
os.environ.get(CONFIGURATION_ENV))
os.environ.get(CONFIGURATION_ENV) or
early_config.getini(CONFIGURATION_ENV))

if ds:
os.environ[SETTINGS_MODULE_ENV] = ds
Expand Down

0 comments on commit 038ca82

Please sign in to comment.