From 5d301b44b948da336435c458245766709b6d2042 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 1 Aug 2020 22:23:33 +0900 Subject: 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. --- tests/test_ext_autodoc.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/test_ext_autodoc.py') 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', -- cgit v1.2.1