mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +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:
parent
68a439a18d
commit
b5c1a85b50
8 changed files with 204 additions and 16 deletions
|
@ -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 ...>
|
||||
--------------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue