Skip to content

Commit

Permalink
fixup! Avoid running database migrations for SimpleTestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
flaeppe committed Apr 13, 2024
1 parent a721159 commit 1f47907
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,11 @@ def non_debugging_runtest(self) -> None:

if request.cls.databases:
request.getfixturevalue("django_db_setup")
db_unblock = django_db_blocker.unblock()
else:
db_unblock = contextlib.nullcontext()

with django_db_blocker.unblock():
with db_unblock:
yield
finally:
TestCaseFunction.runtest = original_runtest # type: ignore[method-assign]
Expand Down

0 comments on commit 1f47907

Please sign in to comment.