Skip to content

Commit 6aa86bd

Browse files
[3.11] gh-113360: Fix the documentation of module's attribute __test__ (GH-113393) (GH-113761)
It can only be a dict since Python 2.4. (cherry picked from commit d99d871) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 9dd73cc commit 6aa86bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/library/doctest.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ searched. Objects imported into the module are not searched.
280280
In addition, there are cases when you want tests to be part of a module but not part
281281
of the help text, which requires that the tests not be included in the docstring.
282282
Doctest looks for a module-level variable called ``__test__`` and uses it to locate other
283-
tests. If ``M.__test__`` exists and is truthy, it must be a dict, and each
283+
tests. If ``M.__test__`` exists, it must be a dict, and each
284284
entry maps a (string) name to a function object, class object, or string.
285285
Function and class object docstrings found from ``M.__test__`` are searched, and
286286
strings are treated as if they were docstrings. In output, a key ``K`` in
@@ -942,8 +942,8 @@ and :ref:`doctest-simple-testfile`.
942942
(or module :mod:`__main__` if *m* is not supplied or is ``None``), starting with
943943
``m.__doc__``.
944944

945-
Also test examples reachable from dict ``m.__test__``, if it exists and is not
946-
``None``. ``m.__test__`` maps names (strings) to functions, classes and
945+
Also test examples reachable from dict ``m.__test__``, if it exists.
946+
``m.__test__`` maps names (strings) to functions, classes and
947947
strings; function and class docstrings are searched for examples; strings are
948948
searched directly, as if they were docstrings.
949949

0 commit comments

Comments
 (0)