Skip to content

Commit 9a1375a

Browse files
authored
Merge branch 'main' into dev/remove-codecov
2 parents d795df0 + 7c99f33 commit 9a1375a

File tree

5 files changed

+28
-20
lines changed

5 files changed

+28
-20
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ jobs:
3232
- name: linting,docs
3333
python: '3.13'
3434
allow_failure: false
35+
36+
# # Explicitly test min pytest.
37+
# - name: py313-dj52-sqlite-pytestmin-coverage
38+
# python: '3.13'
39+
# allow_failure: false
3540

3641
# - name: py313-dj52-postgres-xdist-coverage
3742
# python: '3.13'

docs/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
=========
33

4+
v4.12.0 (Not released yet)
5+
--------------------------
6+
7+
Improvements
8+
^^^^^^^^^^^^
9+
10+
* The :ref:`multiple databases <multi-db>` support added in v4.3.0 is no longer considered experimental.
11+
412
v4.11.1 (2025-04-03)
513
--------------------
614

docs/database.rst

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ documentation <pytest:scoped-marking>` for detail::
3737
assert me.is_superuser
3838

3939

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

6868
.. versionadded:: 4.3
6969

70-
.. caution::
71-
72-
This support is **experimental** and is subject to change without
73-
deprecation. We are still figuring out the best way to expose this
74-
functionality. If you are using this successfully or unsuccessfully,
75-
`let us know <https://github.com/pytest-dev/pytest-django/issues/924>`_!
76-
77-
``pytest-django`` has experimental support for multi-database configurations.
78-
Currently ``pytest-django`` does not specifically support Django's
79-
multi-database support, using the ``databases`` argument to the
80-
:func:`django_db <pytest.mark.django_db>` mark::
70+
``pytest-django`` has support for multi-database configurations using the
71+
``databases`` argument to the :func:`django_db <pytest.mark.django_db>` mark::
8172

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

77+
If you don't specify ``databases``, only the default database is requested.
78+
To request all databases, you may use the shortcut ``'__all__'``.
79+
8680
For details see :attr:`django.test.TransactionTestCase.databases` and
8781
:attr:`django.test.TestCase.databases`.
8882

docs/helpers.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,10 @@ dynamically in a hook or fixture.
5959

6060
:type databases: Iterable[str] | str | None
6161
:param databases:
62-
.. caution::
63-
64-
This argument is **experimental** and is subject to change without
65-
deprecation. We are still figuring out the best way to expose this
66-
functionality. If you are using this successfully or unsuccessfully,
67-
`let us know <https://github.com/pytest-dev/pytest-django/issues/924>`_!
6862

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

pytest_django/asserts.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ def assertInHTML(
161161
msg_prefix: str = ...,
162162
) -> None: ...
163163

164+
# Added in Django 5.1.
165+
def assertNotInHTML(
166+
needle: str,
167+
haystack: str,
168+
msg_prefix: str = ...,
169+
) -> None: ...
170+
164171
def assertJSONEqual(
165172
raw: str,
166173
expected_data: Any,

0 commit comments

Comments
 (0)