Skip to content
Merged
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
9 changes: 1 addition & 8 deletions pytest_django/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ def _django_db_helper(
django_db_setup: None,
django_db_blocker: DjangoDbBlocker,
) -> Generator[None, None, None]:
from django import VERSION

if is_django_unittest(request):
yield
return
Expand Down Expand Up @@ -240,13 +238,9 @@ class PytestDjangoTestCase(test_case_class): # type: ignore[misc,valid-type]
@classmethod
def setUpClass(cls) -> None:
super(django.test.TestCase, cls).setUpClass()
if VERSION < (4, 1):
django.db.transaction.Atomic._ensure_durability = False

@classmethod
def tearDownClass(cls) -> None:
if VERSION < (4, 1):
django.db.transaction.Atomic._ensure_durability = True
super(django.test.TestCase, cls).tearDownClass()

PytestDjangoTestCase.setUpClass()
Expand All @@ -260,8 +254,7 @@ def tearDownClass(cls) -> None:

PytestDjangoTestCase.tearDownClass()

if VERSION >= (4, 0):
PytestDjangoTestCase.doClassCleanups()
PytestDjangoTestCase.doClassCleanups()

django_db_blocker.restore()

Expand Down