Kaydet (Commit) b6203144 authored tarafından Tianyi Wang's avatar Tianyi Wang Kaydeden (comit) Baptiste Mispelon

Fixed #21625 -- incorrect documentation for DiscoverRunner.build_suite

üst 9bfdad54
...@@ -377,21 +377,9 @@ Methods ...@@ -377,21 +377,9 @@ Methods
Run the test suite. Run the test suite.
``test_labels`` is a list of strings describing the tests to be run. A test ``test_labels`` allows you to specify which tests to run and supports
label can take one of four forms: several formats (see :meth:`DiscoverRunner.build_suite` for a list of
supported formats).
* ``path.to.test_module.TestCase.test_method`` -- Run a single test method
in a test case.
* ``path.to.test_module.TestCase`` -- Run all the test methods in a test
case.
* ``path.to.module`` -- Search for and run all tests in the named Python
package or module.
* ``path/to/directory`` -- Search for and run all tests below the named
directory.
If ``test_labels`` has a value of ``None``, the test runner will search for
tests in all files below the current directory whose names match its
``pattern`` (see above).
``extra_tests`` is a list of extra ``TestCase`` instances to add to the ``extra_tests`` is a list of extra ``TestCase`` instances to add to the
suite that is executed by the test runner. These extra tests are run suite that is executed by the test runner. These extra tests are run
...@@ -410,15 +398,20 @@ Methods ...@@ -410,15 +398,20 @@ Methods
Constructs a test suite that matches the test labels provided. Constructs a test suite that matches the test labels provided.
``test_labels`` is a list of strings describing the tests to be run. A test ``test_labels`` is a list of strings describing the tests to be run. A test
label can take one of three forms: label can take one of four forms:
* ``app.TestCase.test_method`` -- Run a single test method in a test * ``path.to.test_module.TestCase.test_method`` -- Run a single test method
in a test case.
* ``path.to.test_module.TestCase`` -- Run all the test methods in a test
case. case.
* ``app.TestCase`` -- Run all the test methods in a test case. * ``path.to.module`` -- Search for and run all tests in the named Python
* ``app`` -- Search for and run all tests in the named application. package or module.
* ``path/to/directory`` -- Search for and run all tests below the named
directory.
If ``test_labels`` has a value of ``None``, the test runner should run If ``test_labels`` has a value of ``None``, the test runner will search for
search for tests in all the applications in :setting:`INSTALLED_APPS`. tests in all files below the current directory whose names match its
``pattern`` (see above).
``extra_tests`` is a list of extra ``TestCase`` instances to add to the ``extra_tests`` is a list of extra ``TestCase`` instances to add to the
suite that is executed by the test runner. These extra tests are run suite that is executed by the test runner. These extra tests are run
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment