diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-01-05 22:23:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-05 22:23:16 (GMT) |
commit | d99d8712253c3affc54cf7f6e71f161dea8347ce (patch) | |
tree | db9074c833d9893f12db125cdc5ec9f540fb70f4 | |
parent | bd754b93ca837aa1f239252437a211271d068b71 (diff) | |
download | cpython-d99d8712253c3affc54cf7f6e71f161dea8347ce.zip cpython-d99d8712253c3affc54cf7f6e71f161dea8347ce.tar.gz cpython-d99d8712253c3affc54cf7f6e71f161dea8347ce.tar.bz2 |
gh-113360: Fix the documentation of module's attribute __test__ (GH-113393)
It can only be a dict since Python 2.4.
-rw-r--r-- | Doc/library/doctest.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index 8c28e44..e4bb6f5 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -280,7 +280,7 @@ searched. Objects imported into the module are not searched. In addition, there are cases when you want tests to be part of a module but not part of the help text, which requires that the tests not be included in the docstring. Doctest looks for a module-level variable called ``__test__`` and uses it to locate other -tests. If ``M.__test__`` exists and is truthy, it must be a dict, and each +tests. If ``M.__test__`` exists, it must be a dict, and each entry maps a (string) name to a function object, class object, or string. Function and class object docstrings found from ``M.__test__`` are searched, and strings are treated as if they were docstrings. In output, a key ``K`` in @@ -944,8 +944,8 @@ and :ref:`doctest-simple-testfile`. (or module :mod:`__main__` if *m* is not supplied or is ``None``), starting with ``m.__doc__``. - Also test examples reachable from dict ``m.__test__``, if it exists and is not - ``None``. ``m.__test__`` maps names (strings) to functions, classes and + Also test examples reachable from dict ``m.__test__``, if it exists. + ``m.__test__`` maps names (strings) to functions, classes and strings; function and class docstrings are searched for examples; strings are searched directly, as if they were docstrings. |