You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ python3 -m doctest -v mwe.pyTrying: print(Class().regularmethod(5))Expecting: foook2 items had no tests: mwe mwe.Class1 item passed all tests: 1 test in mwe.Class.regularmethod1 test in 3 items.1 passed.Test passed.
doctest only finds one doctest, where there should be two.
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
Doctest does not recognize tests in the docstrings of methods decorated with
functools.singledispatchmethod
. There's 2 causes:cpython/Lib/doctest.py
Lines 1061 to 1073 in df4a2f5
functools.singledispatchmethod
does not callfunctools.update_wrapper
on its instance, only on the wrapper function returned from its__get__
method.A similar issue for
cached_property
was fixed in #107996.Example
doctest
only finds one doctest, where there should be two.CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: