Skip to content

Commit a9bb0c7

Browse files
committed
Add comment
1 parent 7ade62a commit a9bb0c7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pytest_django/plugin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,8 @@ def non_debugging_runtest(self) -> None:
559559
try:
560560
TestCaseFunction.runtest = non_debugging_runtest # type: ignore[method-assign]
561561

562+
# Don't set up the DB if the unittest does not require DB.
563+
# The `databases` propery seems like the best indicator for that.
562564
if request.cls.databases:
563565
request.getfixturevalue("django_db_setup")
564566
db_unblock = django_db_blocker.unblock()

0 commit comments

Comments
 (0)