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