Skip to content

Commit

Permalink
Fixed #21068 -- Added some docs for DiscoverRunner
Browse files Browse the repository at this point in the history
Thanks jcd.
  • Loading branch information
timgraham committed Sep 7, 2013
1 parent 04415bf commit e4b012f
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions docs/topics/testing/advanced.txt
Expand Up @@ -298,11 +298,13 @@ Defining a test runner


.. currentmodule:: django.test.runner .. currentmodule:: django.test.runner


.. versionadded:: 1.6

A test runner is a class defining a ``run_tests()`` method. Django ships A test runner is a class defining a ``run_tests()`` method. Django ships
with a ``DiscoverRunner`` class that defines the default Django with a ``DiscoverRunner`` class that defines the default Django testing
testing behavior. This class defines the ``run_tests()`` entry point, behavior. This class defines the ``run_tests()`` entry point, plus a
plus a selection of other methods that are used to by ``run_tests()`` to selection of other methods that are used to by ``run_tests()`` to set up,
set up, execute and tear down the test suite. execute and tear down the test suite.


.. class:: DiscoverRunner(pattern='test*.py', top_level=None, verbosity=1, interactive=True, failfast=True, **kwargs) .. class:: DiscoverRunner(pattern='test*.py', top_level=None, verbosity=1, interactive=True, failfast=True, **kwargs)


Expand Down Expand Up @@ -339,6 +341,13 @@ set up, execute and tear down the test suite.
Attributes Attributes
~~~~~~~~~~ ~~~~~~~~~~


.. attribute:: DiscoverRunner.test_loader

This is the class that loads tests, whether from TestCases or modules or
otherwise and bundles them into test suites for the runner to execute.
By default it is set to ``unittest.defaultTestLoader``. You can override
this attribute if your tests are going to be loaded in unusual ways.

.. attribute:: DiscoverRunner.option_list .. attribute:: DiscoverRunner.option_list


This is the tuple of ``optparse`` options which will be fed into the This is the tuple of ``optparse`` options which will be fed into the
Expand Down

0 comments on commit e4b012f

Please sign in to comment.