Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Explain the order of where pytest-django finds DJANGO_SETTINGS_MODULE
Browse files Browse the repository at this point in the history
This was changed before the 2.9.0 release and was not documented. The
change is backward incompatible and may surprise users.

Then change was originally made in pytest-dev#199.
  • Loading branch information
pelme authored and mfa committed May 17, 2017
1 parent 472af1c commit 0a1b164
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ Compatibility
* Drop support for Django 1.3. While pytest-django supports a wide range of
Django versions, extended for Django 1.3 was dropped in february 2013.

* Settings defined in `pytest.ini`/`tox.ini`/`setup.cfg` used to override
`DJANGO_SETTINGS_MODULE` defined in the environment. Previously the order was
undocmented. Now, instead the settings from the environment will be used
instead. If you previously relied on overriding the enviornment variable, you
can instead specify `addopts = --ds=yourtestsettings` in the ini-file which
will use the test settings. See `PR #199
<https://github.com/pytest-dev/pytest-django/pull/199>`_.

2.8.0
-----

Expand Down
6 changes: 6 additions & 0 deletions docs/configuring_django.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Example contents of pytest.ini::
[pytest]
DJANGO_SETTINGS_MODULE = test_settings

Order of choosing settings
--------------------------

If `--ds`, the environment variable and the pytest.ini configuration is used at
the same time, pytest-django will first prefer using settings from the command
line option `--ds`, then the environment variable and last the pytest.ini.

Using django-configurations
---------------------------
Expand Down

0 comments on commit 0a1b164

Please sign in to comment.