Skip to content

Commit 95b3185

Browse files
authored
Merge branch 'main' into patch-3
2 parents d8c722a + ba335ce commit 95b3185

21 files changed

Lines changed: 134 additions & 134 deletions

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
persist-credentials: false
2020

2121
- name: Build and Check Package
22-
uses: hynek/build-and-inspect-python-package@b5076c307dc91924a82ad150cdd1533b444d3310 # v2.12.0
22+
uses: hynek/build-and-inspect-python-package@c52c3a4710070b50470d903818a7b25115dcd076 # v2.13.0
2323

2424
deploy:
2525
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest-django'

.github/workflows/main.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
push:
55
branches:
66
- main
7+
tags:
8+
- "*"
79
pull_request:
8-
branches:
9-
- main
1010

1111
concurrency:
12-
group: ci-main-${{ github.ref }}
12+
group: ${{ github.workflow }}-${{ github.ref }}
1313
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1414

1515
env:
@@ -25,6 +25,9 @@ jobs:
2525
timeout-minutes: 15
2626
permissions:
2727
contents: read
28+
security-events: write
29+
env:
30+
TOXENV: ${{ matrix.name }}
2831
steps:
2932
- uses: actions/checkout@v4
3033
with:
@@ -50,10 +53,17 @@ jobs:
5053
- name: Install dependencies
5154
run: |
5255
python -m pip install --upgrade pip
53-
pip install tox==4.11.1
56+
pip install tox==4.26.0
5457
5558
- name: Run tox
56-
run: tox -e ${{ matrix.name }}
59+
run: tox
60+
61+
- name: Upload zizmor SARIF report into the GitHub repo code scanning
62+
if: contains(matrix.name, 'linting')
63+
uses: github/codeql-action/upload-sarif@v3
64+
with:
65+
sarif_file: zizmor.sarif
66+
category: zizmor
5767

5868
- name: Report coverage
5969
if: contains(matrix.name, 'coverage')
@@ -71,6 +81,11 @@ jobs:
7181
python: '3.13'
7282
allow_failure: false
7383

84+
# Explicitly test min pytest.
85+
- name: py313-dj52-sqlite-pytestmin-coverage
86+
python: '3.13'
87+
allow_failure: false
88+
7489
- name: py313-dj52-postgres-xdist-coverage
7590
python: '3.13'
7691
allow_failure: false
@@ -131,15 +146,6 @@ jobs:
131146
python: '3.11'
132147
allow_failure: false
133148

134-
- name: py38-dj42-sqlite-xdist-coverage
135-
python: '3.8'
136-
allow_failure: false
137-
138-
# Explicitly test min pytest.
139-
- name: py38-dj42-sqlite-pytestmin-coverage
140-
python: '3.8'
141-
allow_failure: false
142-
143149
# pypy3: not included with coverage reports (much slower then).
144150
- name: pypy3-dj42-postgres
145151
python: 'pypy3.9'

.github/zizmor.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rules:
2+
unpinned-uses:
3+
config:
4+
policies:
5+
actions/*: ref-pin
6+
codecov/codecov-action: ref-pin
7+
github/*: ref-pin

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ _build
1818
*.egg
1919
# autogenerated by setuptools-scm
2020
/pytest_django/_version.py
21+
zizmor.sarif

Makefile

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ pytest-django allows you to test your Django project/applications with the
3232
<https://pytest-django.readthedocs.io/en/latest/contributing.html>`_
3333
* Version compatibility:
3434

35-
* Django: 4.2, 5.0, 5.1, 5.2 and latest main branch (compatible at the time
35+
* Django: 4.2, 5.1, 5.2 and latest main branch (compatible at the time
3636
of each release)
37-
* Python: CPython>=3.8 or PyPy 3
37+
* Python: CPython>=3.9 or PyPy 3
3838
* pytest: >=7.0
3939

4040
For compatibility with older versions, use previous pytest-django releases.

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/contributing.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ writing), running them all will take a long time. All valid configurations can
140140
be found in `tox.ini`. To test against a few of them, invoke tox with the `-e`
141141
flag::
142142

143-
$ tox -e py38-dj32-postgres,py310-dj41-mysql
143+
$ tox -e py39-dj42-postgres,py310-dj52-mysql
144144

145-
This will run the tests on Python 3.8/Django 3.2/PostgeSQL and Python
146-
3.10/Django 4.1/MySQL.
145+
This will run the tests on Python 3.9/Django 4.2/PostgeSQL and Python
146+
3.10/Django 5.2/MySQL.
147147

148148

149149
Measuring test coverage

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`.

0 commit comments

Comments
 (0)