This release is backward incompatible. The biggest change is the need
to add the pytest.mark.django_db to tests which needs database
Finding such tests is generally very easy: just run your test suite, the
tests which needs database access will fail. Add pytestmark =
pytest.mark.django_db to the module/class or decorate them with
Most of the interals has been rewritten, exploiting py.test’s new
fixtures API. This release would not be possible without Floris
Bruynooghe who did the port to the new fixture API and fixed a number of
The tests for pytest-django itself has been greatly improved, paving the
way for easier additions of new and exciting features in the future!
- Semantic version numbers will now be used for releases, see http://semver.org/.
- Do not allow database access in tests by default. Introduce
pytest.mark.django_db to enable database access.
- Large parts re-written using py.test’s 2.3 fixtures API (issue #9).
- Fixes issue #17: Database changes made in fixtures or funcargs
will now be reverted as well.
- Fixes issue 21: Database teardown errors are no longer hidden.
- Fixes issue 16: Database setup and teardown for non-TestCase
classes works correctly.
- pytest.urls() is replaced by the standard marking API and is now
used as pytest.mark.urls()
- Make the plugin behave gracefully without DJANGO_SETTINGS_MODULE
specified. py.test will still work and tests needing django
features will skip (issue #3).
- Allow specifying of DJANGO_SETTINGS_MODULE on the command line
(--ds=settings) and py.test ini configuration file as well as the
environment variable (issue #3).
- Deprecate the transaction_test_case decorator, this is now
integrated with the django_db mark.