Skip to content

Commit 0e74f03

Browse files
committed
Call Django's setUpClass()/tearDownClass()
This lets Django do its thing without us having to implement it ourselves: - The durability stuff - Checking the `databases` attribute (not used yet) It does some other stuff that relies on attributes that we don't set so ends up a noop.
1 parent 178b5e2 commit 0e74f03

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pytest_django/fixtures.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,8 @@ class PytestDjangoTestCase(test_case_class): # type: ignore[misc,valid-type]
159159
if transactional and _reset_sequences:
160160
reset_sequences = True
161161

162-
if not transactional:
163-
django.db.transaction.Atomic._ensure_durability = False
164-
165-
def reset_durability() -> None:
166-
django.db.transaction.Atomic._ensure_durability = True
167-
request.addfinalizer(reset_durability)
162+
PytestDjangoTestCase.setUpClass()
163+
request.addfinalizer(PytestDjangoTestCase.tearDownClass)
168164

169165
test_case = PytestDjangoTestCase(methodName="__init__")
170166
test_case._pre_setup()

0 commit comments

Comments
 (0)