summaryrefslogtreecommitdiff
path: root/tests/test_ext_autodoc.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-08-01 22:23:33 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-08-02 18:27:03 +0900
commit5d301b44b948da336435c458245766709b6d2042 (patch)
tree10853ccb67a829689322a232c3116434e4f38c08 /tests/test_ext_autodoc.py
parentcc25bac26445688c50efb9b8d5f30571940e27bd (diff)
downloadsphinx-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.py14
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',