autodoc: Support type_comment styled type annotation for variables

This commit is contained in:
Takeshi KOMIYA
2020-02-01 13:38:34 +09:00
parent 20126433d6
commit 92cb828f14
6 changed files with 52 additions and 12 deletions

View File

@@ -1418,10 +1418,8 @@ def test_autodoc_typed_instance_variables(app):
' .. py:attribute:: Class.attr3',
' :module: target.typed_vars',
' :type: int',
' :value: None',
' :value: 0',
' ',
' attr3',
' ',
' ',
' .. py:attribute:: Class.attr4',
' :module: target.typed_vars',
@@ -1430,6 +1428,22 @@ def test_autodoc_typed_instance_variables(app):
' ',
' attr4',
' ',
' ',
' .. py:attribute:: Class.attr5',
' :module: target.typed_vars',
' :type: int',
' :value: None',
' ',
' attr5',
' ',
' ',
' .. py:attribute:: Class.attr6',
' :module: target.typed_vars',
' :type: int',
' :value: None',
' ',
' attr6',
' ',
'',
'.. py:data:: attr1',
' :module: target.typed_vars',
@@ -1442,9 +1456,17 @@ def test_autodoc_typed_instance_variables(app):
'.. py:data:: attr2',
' :module: target.typed_vars',
' :type: str',
" :value: None",
' :value: None',
'',
' attr2',
' ',
'',
'.. py:data:: attr3',
' :module: target.typed_vars',
' :type: str',
" :value: ''",
'',
' attr3',
' '
]