Skip to content

Commit c19d22f

Browse files
committed
Apply review wording for test_main and reap_children.
1 parent aabe5ea commit c19d22f

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎Doc/library/test.rst‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,9 @@ script by itself automatically starts running all regression tests in the
169169
start with ``test_``, importing each one, and loading its tests with
170170
:meth:`unittest.TestLoader.loadTestsFromModule`. See the
171171
:ref:`load_tests protocol <load_tests-protocol>` for how a module or package
172-
can customize what is loaded. A module-level ``test_main()`` function is not
173-
called. If a test module defines ``test_main``, :mod:`!test.regrtest` fails
174-
that test. The names of
175-
tests to execute may also be passed to the script. Specifying a single
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
176175
regression test (:program:`python -m test test_spam`) will minimize output and
177176
only print whether the test passed or failed.
178177

@@ -885,9 +884,9 @@ The :mod:`!test.support` module defines the following functions:
885884

886885
.. function:: reap_children()
887886

888-
Call this from a test's :meth:`~unittest.TestCase.setUp`,
889-
:meth:`~unittest.TestCase.tearDown`, or ``tearDownModule`` when the
890-
test starts subprocesses. This will help ensure that no extra children
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
891890
(zombies) stick around to hog resources and create problems when looking
892891
for refleaks.
893892

‎Lib/test/support/__init__.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,9 +1595,9 @@ def set_environment_altered(reason):
15951595

15961596

15971597
def reap_children():
1598-
"""Call this from a test's setUp(), tearDown(), or tearDownModule()
1599-
when the test starts subprocesses. This will help ensure that no extra
1600-
children (zombies) stick around to hog resources and create problems when
1598+
"""Call this from setUp(), tearDown(), or tearDownModule() in tests
1599+
that start subprocesses. This will help ensure that no extra children
1600+
(zombies) stick around to hog resources and create problems when
16011601
looking for refleaks.
16021602
"""
16031603
# Need os.waitpid(-1, os.WNOHANG): Windows is not supported

0 commit comments

Comments
 (0)