summaryrefslogtreecommitdiff
path: root/docs/topics/testing
diff options
context:
space:
mode:
Diffstat (limited to 'docs/topics/testing')
-rw-r--r--docs/topics/testing/advanced.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt
index 14a45931ba..54b9d7d133 100644
--- a/docs/topics/testing/advanced.txt
+++ b/docs/topics/testing/advanced.txt
@@ -533,7 +533,7 @@ behavior. This class defines the ``run_tests()`` entry point, plus a
selection of other methods that are used by ``run_tests()`` to set up, execute
and tear down the test suite.
-.. class:: DiscoverRunner(pattern='test*.py', top_level=None, verbosity=1, interactive=True, failfast=False, keepdb=False, reverse=False, debug_mode=False, debug_sql=False, parallel=0, tags=None, exclude_tags=None, test_name_patterns=None, pdb=False, buffer=False, enable_faulthandler=True, timing=True, shuffle=False, logger=None, **kwargs)
+.. class:: DiscoverRunner(pattern='test*.py', top_level=None, verbosity=1, interactive=True, failfast=False, keepdb=False, reverse=False, debug_mode=False, debug_sql=False, parallel=0, tags=None, exclude_tags=None, test_name_patterns=None, pdb=False, buffer=False, enable_faulthandler=True, timing=True, shuffle=False, logger=None, durations=None, **kwargs)
``DiscoverRunner`` will search for tests in any file matching ``pattern``.
@@ -613,6 +613,10 @@ and tear down the test suite.
the console. The logger object will respect its logging level rather than
the ``verbosity``.
+ ``durations`` will show a list of the N slowest test cases. Setting this
+ option to ``0`` will result in the duration for all tests being shown.
+ Requires Python 3.12+.
+
Django may, from time to time, extend the capabilities of the test runner
by adding new arguments. The ``**kwargs`` declaration allows for this
expansion. If you subclass ``DiscoverRunner`` or write your own test
@@ -623,6 +627,10 @@ and tear down the test suite.
custom arguments by calling ``parser.add_argument()`` inside the method, so
that the :djadmin:`test` command will be able to use those arguments.
+ .. versionadded:: 5.0
+
+ The ``durations`` argument was added.
+
Attributes
~~~~~~~~~~