Skip to content

Commit 43c6804

Browse files
Skipped test_no_logs_without_debug test when the runner is invoked with --debug-sql.
1 parent 395e498 commit 43c6804

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/backends/base/test_base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
TransactionTestCase,
1010
skipUnlessDBFeature,
1111
)
12+
from django.test.runner import DebugSQLTextTestResult
1213
from django.test.utils import CaptureQueriesContext, override_settings
1314

1415
from ..models import Person, Square
@@ -134,6 +135,8 @@ def test_rollback_debug_log(self):
134135
)
135136

136137
def test_no_logs_without_debug(self):
138+
if isinstance(self._outcome.result, DebugSQLTextTestResult):
139+
self.skipTest("--debug-sql interferes with this test")
137140
with self.assertNoLogs("django.db.backends", "DEBUG"):
138141
with self.assertRaises(Exception), transaction.atomic():
139142
Person.objects.create(first_name="first", last_name="last")

0 commit comments

Comments
 (0)