mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #9866: autodoc: doccoment for the imported class was ignored
Autodoc tried to scan doccomment on the module where the class defined. But it failed to get it if the class is imported from other module. This analyzes the target module to obtain the doccomment.
This commit is contained in:
@@ -407,6 +407,18 @@ def test_class_alias_having_doccomment(app):
|
||||
]
|
||||
|
||||
|
||||
def test_class_alias_for_imported_object_having_doccomment(app):
|
||||
actual = do_autodoc(app, 'class', 'target.classes.IntAlias')
|
||||
assert list(actual) == [
|
||||
'',
|
||||
'.. py:attribute:: IntAlias',
|
||||
' :module: target.classes',
|
||||
'',
|
||||
' docstring',
|
||||
'',
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='ext-autodoc')
|
||||
def test_coroutine(app):
|
||||
options = {"members": None}
|
||||
|
||||
Reference in New Issue
Block a user