Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d43f2ad

Browse filesBrowse files
[3.12] gh-113360: Fix the documentation of module's attribute __test__ (GH-113393) (GH-113760)
It can only be a dict since Python 2.4. (cherry picked from commit d99d871) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 05a2546 commit d43f2ad
Copy full SHA for d43f2ad

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎Doc/library/doctest.rst

Copy file name to clipboardExpand all lines: Doc/library/doctest.rst
+3-3Lines changed: 3 additions & 3 deletions
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
@@ -944,8 +944,8 @@ and :ref:`doctest-simple-testfile`.
944944
(or module :mod:`__main__` if *m* is not supplied or is ``None``), starting with
945945
``m.__doc__``.
946946

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.