diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-08-01 22:23:33 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-08-02 18:27:03 +0900 |
| commit | 5d301b44b948da336435c458245766709b6d2042 (patch) | |
| tree | 10853ccb67a829689322a232c3116434e4f38c08 /tests/test_ext_autodoc.py | |
| parent | cc25bac26445688c50efb9b8d5f30571940e27bd (diff) | |
| download | sphinx-git-5d301b44b948da336435c458245766709b6d2042.tar.gz | |
Fix #8032: autodoc: A typehint for inherited ivars is not shown
This tries to import the parent object for the instance attribute
to get type annotations for the variable.
Diffstat (limited to 'tests/test_ext_autodoc.py')
| -rw-r--r-- | tests/test_ext_autodoc.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_ext_autodoc.py b/tests/test_ext_autodoc.py index be46c1490..8fa61e044 100644 --- a/tests/test_ext_autodoc.py +++ b/tests/test_ext_autodoc.py @@ -1576,6 +1576,20 @@ def test_autodoc_typed_instance_variables(app): ' This is descr4', '', '', + '.. py:class:: Derived()', + ' :module: target.typed_vars', + '', + '', + ' .. py:attribute:: Derived.attr2', + ' :module: target.typed_vars', + ' :type: int', + '', + '', + ' .. py:attribute:: Derived.descr4', + ' :module: target.typed_vars', + ' :type: int', + '', + '', '.. py:data:: attr1', ' :module: target.typed_vars', ' :type: str', |
