mirror of
https://github.com/django/django.git
synced 2025-08-21 09:19:12 +00:00
Skipped test_no_logs_without_debug test when the runner is invoked with --debug-sql.
This commit is contained in:
parent
395e498553
commit
43c68042c9
@ -9,6 +9,7 @@ from django.test import (
|
|||||||
TransactionTestCase,
|
TransactionTestCase,
|
||||||
skipUnlessDBFeature,
|
skipUnlessDBFeature,
|
||||||
)
|
)
|
||||||
|
from django.test.runner import DebugSQLTextTestResult
|
||||||
from django.test.utils import CaptureQueriesContext, override_settings
|
from django.test.utils import CaptureQueriesContext, override_settings
|
||||||
|
|
||||||
from ..models import Person, Square
|
from ..models import Person, Square
|
||||||
@ -134,6 +135,8 @@ class DatabaseWrapperLoggingTests(TransactionTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def test_no_logs_without_debug(self):
|
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.assertNoLogs("django.db.backends", "DEBUG"):
|
||||||
with self.assertRaises(Exception), transaction.atomic():
|
with self.assertRaises(Exception), transaction.atomic():
|
||||||
Person.objects.create(first_name="first", last_name="last")
|
Person.objects.create(first_name="first", last_name="last")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user