@@ -165,11 +165,13 @@ test suite, thanks to the :option:`-m` option: :program:`python -m test`. Under
165165the hood, it uses :mod: `!test.regrtest `; the call :program: `python -m
166166test.regrtest ` used in previous Python versions still works. Running the
167167script by itself automatically starts running all regression tests in the
168- :mod: `!test ` package. It does this by finding all modules in the package whose
169- name starts with ``test_ ``, importing them, and executing the function
170- :func: `test_main ` if present or loading the tests via
171- unittest.TestLoader.loadTestsFromModule if ``test_main `` does not exist. The
172- names of tests to execute may also be passed to the script. Specifying a single
168+ :mod: `!test ` package. It does this by finding modules and packages whose names
169+ start with ``test_ ``, importing each one, and loading its tests with
170+ :meth: `unittest.TestLoader.loadTestsFromModule `. See the
171+ :ref: `load_tests protocol <load_tests-protocol >` for how a module or package
172+ can customize what is loaded. Defining a module-level ``test_main() `` function
173+ is not supported and causes the test to fail. The names of tests to
174+ execute may also be passed to the script. Specifying a single
173175regression test (:program: `python -m test test_spam `) will minimize output and
174176only print whether the test passed or failed.
175177
@@ -882,9 +884,11 @@ The :mod:`!test.support` module defines the following functions:
882884
883885.. function :: reap_children()
884886
885- Use this at the end of ``test_main `` whenever sub-processes are started.
886- This will help ensure that no extra children (zombies) stick around to
887- hog resources and create problems when looking for refleaks.
887+ Call this from :meth: `~unittest.TestCase.setUp `,
888+ :meth: `~unittest.TestCase.tearDown `, or ``tearDownModule() `` in tests
889+ that start subprocesses. This will help ensure that no extra children
890+ (zombies) stick around to hog resources and create problems when looking
891+ for refleaks.
888892
889893
890894.. function :: get_attribute(obj, name)
0 commit comments