mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #24118 -- Added --debug-sql option for tests.
Added a --debug-sql option for tests and runtests.py which outputs the SQL logger for failing tests. When combined with --verbosity=2, it also outputs the SQL for passing tests. Thanks to Berker, Tim, Markus, Shai, Josh and Anssi for review and discussion.
This commit is contained in:
@@ -1449,6 +1449,14 @@ This may help in debugging tests that aren't properly isolated and have side
|
||||
effects. :ref:`Grouping by test class <order-of-tests>` is preserved when using
|
||||
this option.
|
||||
|
||||
.. django-admin-option:: --debug-sql
|
||||
|
||||
.. versionadded:: 1.8
|
||||
|
||||
The ``--debug-sql`` option can be used to enable :ref:`SQL logging
|
||||
<django-db-logger>` for failing tests. If :djadminopt:`--verbosity` is ``2``,
|
||||
then queries in passing tests are also output.
|
||||
|
||||
testserver <fixture fixture ...>
|
||||
--------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user