From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:04:57 +0000 (+0200) Subject: [3.13] Fix the doctest.testmod() docstring (GH-136675) (GH-136691) X-Git-Tag: v3.13.6~78 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3e0ead0756063c4e5ccd4ab91ced156938b67bd7;p=thirdparty%2FPython%2Fcpython.git [3.13] Fix the doctest.testmod() docstring (GH-136675) (GH-136691) __test__ = None is not supported since Python 2.4. (cherry picked from commit cb59eaefeda5ff44ac0c742bff2b8afc023be313) Co-authored-by: Serhiy Storchaka --- diff --git a/Lib/doctest.py b/Lib/doctest.py index dd4d62a210a9..05ed6835c1df 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -1989,8 +1989,8 @@ def testmod(m=None, name=None, globs=None, verbose=None, from module m (or the current module if m is not supplied), starting with m.__doc__. - Also test examples reachable from dict m.__test__ if it exists and is - not None. m.__test__ maps names to functions, classes and strings; + Also test examples reachable from dict m.__test__ if it exists. + m.__test__ maps names to functions, classes and strings; function and class docstrings are tested even if the name is private; strings are tested directly, as if they were docstrings.