diff options
| author | Jacob Walls <jacobtylerwalls@gmail.com> | 2025-07-13 12:29:34 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-13 18:29:34 +0200 |
| commit | 43c68042c9cfbf51ceb3ad8dd3a5f0220a2a13e9 (patch) | |
| tree | dd41f7490a606780637ce90bd72999e4d3075c63 /tests/backends | |
| parent | 395e498553e4e01da1ba0ddb5c4708ad9cb8a16a (diff) | |
Skipped test_no_logs_without_debug test when the runner is invoked with --debug-sql.
Diffstat (limited to 'tests/backends')
| -rw-r--r-- | tests/backends/base/test_base.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/backends/base/test_base.py b/tests/backends/base/test_base.py index 8f47e30172..120584e7fc 100644 --- a/tests/backends/base/test_base.py +++ b/tests/backends/base/test_base.py @@ -9,6 +9,7 @@ from django.test import ( TransactionTestCase, skipUnlessDBFeature, ) +from django.test.runner import DebugSQLTextTestResult from django.test.utils import CaptureQueriesContext, override_settings from ..models import Person, Square @@ -134,6 +135,8 @@ class DatabaseWrapperLoggingTests(TransactionTestCase): ) def test_no_logs_without_debug(self): + if isinstance(self._outcome.result, DebugSQLTextTestResult): + self.skipTest("--debug-sql interferes with this test") with self.assertNoLogs("django.db.backends", "DEBUG"): with self.assertRaises(Exception), transaction.atomic(): Person.objects.create(first_name="first", last_name="last") |
