Skip to content

Commit c5465ad

Browse files
hramezanibluetech
authored andcommitted
Add Django main to tox envlist
1 parent ac76775 commit c5465ad

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pytest_django/fixtures.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ def _django_db_fixture_helper(
144144
transactional: bool = False,
145145
reset_sequences: bool = False,
146146
) -> None:
147+
from django import VERSION
148+
147149
if is_django_unittest(request):
148150
return
149151

@@ -175,6 +177,8 @@ class PytestDjangoTestCase(test_case_class): # type: ignore[misc,valid-type]
175177
databases = _databases
176178

177179
PytestDjangoTestCase.setUpClass()
180+
if VERSION >= (4, 0):
181+
request.addfinalizer(PytestDjangoTestCase.doClassCleanups)
178182
request.addfinalizer(PytestDjangoTestCase.tearDownClass)
179183

180184
test_case = PytestDjangoTestCase(methodName="__init__")

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[tox]
22
envlist =
3-
py310-dj32-postgres
4-
py39-dj{32,31,30,22}-postgres
5-
py38-dj{32,31,30,22}-postgres
3+
py310-dj{main,32}-postgres
4+
py39-dj{main,32,31,30,22}-postgres
5+
py38-dj{main,32,31,30,22}-postgres
66
py37-dj{32,31,30,22}-postgres
77
py36-dj{32,31,30,22}-postgres
88
py35-dj{22}-postgres

0 commit comments

Comments
 (0)