Add testcase for instance variables without defaults

This commit is contained in:
Takeshi KOMIYA 2020-01-26 01:25:35 +09:00
parent 045630ec85
commit dcd8f41a77
2 changed files with 19 additions and 1 deletions

View File

@ -7,3 +7,7 @@ attr2: str
class Class:
attr1: int = 0
attr2: int
def __init__(self):
self.attr3: int = 0 #: attr3
self.attr4: int #: attr4

View File

@ -1399,7 +1399,7 @@ def test_autodoc_typed_instance_variables(app):
'.. py:module:: target.typed_vars',
'',
'',
'.. py:class:: Class',
'.. py:class:: Class()',
' :module: target.typed_vars',
'',
' ',
@ -1412,6 +1412,20 @@ def test_autodoc_typed_instance_variables(app):
' :module: target.typed_vars',
' :annotation: = None',
' ',
' ',
' .. py:attribute:: Class.attr3',
' :module: target.typed_vars',
' :annotation: = None',
' ',
' attr3',
' ',
' ',
' .. py:attribute:: Class.attr4',
' :module: target.typed_vars',
' :annotation: = None',
' ',
' attr4',
' ',
'',
'.. py:data:: attr1',
' :module: target.typed_vars',