Fix #6588: autodoc: Decorated inherited method has no documentation

This commit is contained in:
Takeshi KOMIYA committed 2020-04-28 22:33:40 +09:00
1 parent 1f5dab6446
commit 13113fc0b6
4 files changed
+36 -5

No files matched your search

+15
View File
@@ -564,3 +564,18 @@ def test_unpartial():
assert inspect.unpartial(func2) is func1
assert inspect.unpartial(func3) is func1
def test_getdoc_inherited_decorated_method():
class Foo:
def meth(self):
"""docstring."""
class Bar(Foo):
@functools.lru_cache()
def meth(self):
# inherited and decorated method
pass
assert inspect.getdoc(Bar.meth, getattr, False, Bar, "meth") is None
assert inspect.getdoc(Bar.meth, getattr, True, Bar, "meth") == "docstring."