mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-25 14:40:22 -05:00
Fix #6588: autodoc: Decorated inherited method has no documentation
This commit is contained in:
1 parent
1f5dab6446
commit
13113fc0b6
4 files changed
+36
-5
No files matched your search
@@ -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."
|
||||
Reference in new issue
Block a user