mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #9757: autodoc_inherit_docstrings does not effect to overriden classmethods
This commit is contained in:
@@ -677,6 +677,25 @@ def test_unpartial():
|
||||
assert inspect.unpartial(func3) is func1
|
||||
|
||||
|
||||
def test_getdoc_inherited_classmethod():
|
||||
class Foo:
|
||||
@classmethod
|
||||
def meth(self):
|
||||
"""
|
||||
docstring
|
||||
indented text
|
||||
"""
|
||||
|
||||
class Bar(Foo):
|
||||
@classmethod
|
||||
def meth(self):
|
||||
# inherited classmethod
|
||||
pass
|
||||
|
||||
assert inspect.getdoc(Bar.meth, getattr, False, Bar, "meth") is None
|
||||
assert inspect.getdoc(Bar.meth, getattr, True, Bar, "meth") == Foo.meth.__doc__
|
||||
|
||||
|
||||
def test_getdoc_inherited_decorated_method():
|
||||
class Foo:
|
||||
def meth(self):
|
||||
|
||||
Reference in New Issue
Block a user