Skip to content

Remove experimental label from multi-db support #1194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

v4.12.0 (Not released yet)
--------------------------

Improvements
^^^^^^^^^^^^

* The :ref:`multiple databases <multi-db>` support added in v4.3.0 is no longer considered experimental.

v4.11.1 (2025-04-03)
--------------------

Expand Down
20 changes: 7 additions & 13 deletions docs/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ documentation <pytest:scoped-marking>` for detail::
assert me.is_superuser


By default ``pytest-django`` will set up the Django databases the
first time a test needs them. Once setup, the database is cached to be
By default ``pytest-django`` will set up Django databases the
first time a test needs them. Once setup, a database is cached to be
used for all subsequent tests and rolls back transactions, to isolate
tests from each other. This is the same way the standard Django
:class:`~django.test.TestCase` uses the database. However
Expand Down Expand Up @@ -67,22 +67,16 @@ Tests requiring multiple databases

.. versionadded:: 4.3

.. caution::

This support is **experimental** and is subject to change without
deprecation. We are still figuring out the best way to expose this
functionality. If you are using this successfully or unsuccessfully,
`let us know <https://github.com/pytest-dev/pytest-django/issues/924>`_!

``pytest-django`` has experimental support for multi-database configurations.
Currently ``pytest-django`` does not specifically support Django's
multi-database support, using the ``databases`` argument to the
:func:`django_db <pytest.mark.django_db>` mark::
``pytest-django`` has support for multi-database configurations using the
``databases`` argument to the :func:`django_db <pytest.mark.django_db>` mark::

@pytest.mark.django_db(databases=['default', 'other'])
def test_spam():
assert MyModel.objects.using('other').count() == 0

If you don't specify ``databases``, only the default database is requested.
To request all databases, you may use the shortcut ``'__all__'``.

For details see :attr:`django.test.TransactionTestCase.databases` and
:attr:`django.test.TestCase.databases`.

Expand Down
8 changes: 1 addition & 7 deletions docs/helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,10 @@ dynamically in a hook or fixture.

:type databases: Iterable[str] | str | None
:param databases:
.. caution::

This argument is **experimental** and is subject to change without
deprecation. We are still figuring out the best way to expose this
functionality. If you are using this successfully or unsuccessfully,
`let us know <https://github.com/pytest-dev/pytest-django/issues/924>`_!

The ``databases`` argument defines which databases in a multi-database
configuration will be set up and may be used by the test. Defaults to
only the ``default`` database. The special value ``"__all__"`` may be use
only the ``default`` database. The special value ``"__all__"`` may be used
to specify all configured databases.
For details see :attr:`django.test.TransactionTestCase.databases` and
:attr:`django.test.TestCase.databases`.
Expand Down