mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add testcase for instance variables without defaults
This commit is contained in:
parent
045630ec85
commit
dcd8f41a77
@ -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
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user