diff options
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r-- | tests/test_autodoc.py | 78 |
1 files changed, 53 insertions, 25 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index 6fb4db6ad..52e9bf5c5 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -930,7 +930,7 @@ def test_autodoc_module_scope(app): '', '.. py:attribute:: Class.mdocattr', ' :module: target', - ' :annotation: = <_io.StringIO object>', + ' :value: <_io.StringIO object>', '', ' should be documented as well - süß', ' ' @@ -946,7 +946,7 @@ def test_autodoc_class_scope(app): '', '.. py:attribute:: Class.mdocattr', ' :module: target', - ' :annotation: = <_io.StringIO object>', + ' :value: <_io.StringIO object>', '', ' should be documented as well - süß', ' ' @@ -966,12 +966,12 @@ def test_class_attributes(app): ' ', ' .. py:attribute:: AttCls.a1', ' :module: target', - ' :annotation: = hello world', + ' :value: hello world', ' ', ' ', ' .. py:attribute:: AttCls.a2', ' :module: target', - ' :annotation: = None', + ' :value: None', ' ' ] @@ -990,7 +990,7 @@ def test_instance_attributes(app): ' ', ' .. py:attribute:: InstAttCls.ca1', ' :module: target', - " :annotation: = 'a'", + " :value: 'a'", ' ', ' Doc comment for class attribute InstAttCls.ca1.', ' It can have multiple lines.', @@ -998,28 +998,28 @@ def test_instance_attributes(app): ' ', ' .. py:attribute:: InstAttCls.ca2', ' :module: target', - " :annotation: = 'b'", + " :value: 'b'", ' ', ' Doc comment for InstAttCls.ca2. One line only.', ' ', ' ', ' .. py:attribute:: InstAttCls.ca3', ' :module: target', - " :annotation: = 'c'", + " :value: 'c'", ' ', ' Docstring for class attribute InstAttCls.ca3.', ' ', ' ', ' .. py:attribute:: InstAttCls.ia1', ' :module: target', - ' :annotation: = None', + ' :value: None', ' ', ' Doc comment for instance attribute InstAttCls.ia1', ' ', ' ', ' .. py:attribute:: InstAttCls.ia2', ' :module: target', - ' :annotation: = None', + ' :value: None', ' ', ' Docstring for instance attribute InstAttCls.ia2.', ' ' @@ -1038,7 +1038,7 @@ def test_instance_attributes(app): ' ', ' .. py:attribute:: InstAttCls.ca1', ' :module: target', - " :annotation: = 'a'", + " :value: 'a'", ' ', ' Doc comment for class attribute InstAttCls.ca1.', ' It can have multiple lines.', @@ -1046,7 +1046,7 @@ def test_instance_attributes(app): ' ', ' .. py:attribute:: InstAttCls.ia1', ' :module: target', - ' :annotation: = None', + ' :value: None', ' ', ' Doc comment for instance attribute InstAttCls.ia1', ' ' @@ -1114,28 +1114,28 @@ def test_enum_class(app): ' ', ' .. py:attribute:: EnumCls.val1', ' :module: target.enum', - ' :annotation: = 12', + ' :value: 12', ' ', ' doc for val1', ' ', ' ', ' .. py:attribute:: EnumCls.val2', ' :module: target.enum', - ' :annotation: = 23', + ' :value: 23', ' ', ' doc for val2', ' ', ' ', ' .. py:attribute:: EnumCls.val3', ' :module: target.enum', - ' :annotation: = 34', + ' :value: 34', ' ', ' doc for val3', ' ', ' ', ' .. py:attribute:: EnumCls.val4', ' :module: target.enum', - ' :annotation: = 34', + ' :value: 34', ' ' ] @@ -1145,7 +1145,7 @@ def test_enum_class(app): '', '.. py:attribute:: EnumCls.val1', ' :module: target.enum', - ' :annotation: = 12', + ' :value: 12', '', ' doc for val1', ' ' @@ -1429,40 +1429,68 @@ def test_autodoc_typed_instance_variables(app): ' ', ' .. py:attribute:: Class.attr1', ' :module: target.typed_vars', - ' :annotation: = 0', + ' :type: int', + ' :value: 0', ' ', ' ', ' .. py:attribute:: Class.attr2', ' :module: target.typed_vars', - ' :annotation: = None', + ' :type: int', + ' :value: None', ' ', ' ', ' .. py:attribute:: Class.attr3', ' :module: target.typed_vars', - ' :annotation: = None', + ' :type: int', + ' :value: 0', ' ', - ' attr3', - ' ', ' ', ' .. py:attribute:: Class.attr4', ' :module: target.typed_vars', - ' :annotation: = None', + ' :type: int', + ' :value: None', ' ', ' 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', - " :annotation: = ''", + ' :type: str', + " :value: ''", '', ' attr1', ' ', '', '.. py:data:: attr2', ' :module: target.typed_vars', - " :annotation: = None", + ' :type: str', + ' :value: None', '', ' attr2', + ' ', + '', + '.. py:data:: attr3', + ' :module: target.typed_vars', + ' :type: str', + " :value: ''", + '', + ' attr3', ' ' ] @@ -1479,7 +1507,7 @@ def test_autodoc_for_egged_code(app): '', '.. py:data:: CONSTANT', ' :module: sample', - ' :annotation: = 1', + ' :value: 1', '', ' constant on sample.py', ' ', |