mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
autodoc: make full reference for classes, aliased with "alias of"
We do this here only if class belongs to the different module. Closes sphinx-doc/sphinx#2437
This commit is contained in:
5
tests/roots/test-ext-autodoc/autodoc_dummy_bar.py
Normal file
5
tests/roots/test-ext-autodoc/autodoc_dummy_bar.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from bug2437.autodoc_dummy_foo import Foo
|
||||
|
||||
class Bar(object):
|
||||
"""Dummy class Bar with alias."""
|
||||
my_name = Foo
|
||||
0
tests/roots/test-ext-autodoc/bug2437/__init__.py
Normal file
0
tests/roots/test-ext-autodoc/bug2437/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
class Foo(object):
|
||||
"""Dummy class Foo."""
|
||||
pass
|
||||
@@ -10,3 +10,5 @@ source_suffix = '.rst'
|
||||
autodoc_mock_imports = [
|
||||
'dummy'
|
||||
]
|
||||
|
||||
nitpicky = True
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
|
||||
.. automodule:: autodoc_dummy_module
|
||||
:members:
|
||||
|
||||
.. automodule:: bug2437.autodoc_dummy_foo
|
||||
:members:
|
||||
|
||||
.. automodule:: autodoc_dummy_bar
|
||||
:members:
|
||||
|
||||
@@ -22,3 +22,13 @@ def test_autodoc(app, status, warning):
|
||||
assert isinstance(content[3], addnodes.desc)
|
||||
assert content[3][0].astext() == 'autodoc_dummy_module.test'
|
||||
assert content[3][1].astext() == 'Dummy function using dummy.*'
|
||||
|
||||
# issue sphinx-doc/sphinx#2437
|
||||
assert content[11][-1].astext() == """Dummy class Bar with alias.
|
||||
|
||||
|
||||
|
||||
my_name
|
||||
|
||||
alias of bug2437.autodoc_dummy_foo.Foo"""
|
||||
assert warning.getvalue() == ''
|
||||
|
||||
Reference in New Issue
Block a user