Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refs #35448 -- Reverted SQL formatting for test --debug-sql #18164

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions django/test/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
from importlib import import_module
from io import StringIO

import sqlparse

import django
from django.core.management import call_command
from django.db import connections
Expand Down Expand Up @@ -96,9 +94,7 @@ def printErrorList(self, flavour, errors):
self.stream.writeln(self.separator2)
self.stream.writeln(err)
self.stream.writeln(self.separator2)
self.stream.writeln(
sqlparse.format(sql_debug, reindent=True, keyword_case="upper")
)
self.stream.writeln(sql_debug)
JaeHyuckSa marked this conversation as resolved.
Show resolved Hide resolved


class PDBDebugResult(unittest.TextTestResult):
Expand Down
24 changes: 12 additions & 12 deletions tests/test_runner/test_debug_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,24 @@ def test_output_verbose(self):

expected_outputs = [
(
"""SELECT COUNT(*) AS "__count"\n"""
"""FROM "test_runner_person"\n"""
"""WHERE "test_runner_person"."first_name" = 'error';"""
"""SELECT COUNT(*) AS "__count" """
"""FROM "test_runner_person" WHERE """
""""test_runner_person"."first_name" = 'error';"""
),
(
"""SELECT COUNT(*) AS "__count"\n"""
"""FROM "test_runner_person"\n"""
"""WHERE "test_runner_person"."first_name" = 'fail';"""
"""SELECT COUNT(*) AS "__count" """
"""FROM "test_runner_person" WHERE """
""""test_runner_person"."first_name" = 'fail';"""
),
(
"""SELECT COUNT(*) AS "__count"\n"""
"""FROM "test_runner_person"\n"""
"""WHERE "test_runner_person"."first_name" = 'subtest-error';"""
"""SELECT COUNT(*) AS "__count" """
"""FROM "test_runner_person" WHERE """
""""test_runner_person"."first_name" = 'subtest-error';"""
),
(
"""SELECT COUNT(*) AS "__count"\n"""
"""FROM "test_runner_person"\n"""
"""WHERE "test_runner_person"."first_name" = 'subtest-fail';"""
"""SELECT COUNT(*) AS "__count" """
"""FROM "test_runner_person" WHERE """
""""test_runner_person"."first_name" = 'subtest-fail';"""
),
]

Expand Down
Loading