Skip to content

Commit 1f47907

Browse files
committed
fixup! Avoid running database migrations for SimpleTestCase
1 parent a721159 commit 1f47907

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pytest_django/plugin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,11 @@ def non_debugging_runtest(self) -> None:
560560

561561
if request.cls.databases:
562562
request.getfixturevalue("django_db_setup")
563+
db_unblock = django_db_blocker.unblock()
564+
else:
565+
db_unblock = contextlib.nullcontext()
563566

564-
with django_db_blocker.unblock():
567+
with db_unblock:
565568
yield
566569
finally:
567570
TestCaseFunction.runtest = original_runtest # type: ignore[method-assign]

0 commit comments

Comments
 (0)