Skip to content

Commit

Permalink
Fix autodoc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Jan 20, 2025
1 parent 8158a18 commit d691a85
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 25 deletions.
1 change: 0 additions & 1 deletion tests/test_extensions/test_ext_autodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,6 @@ def test_autodoc_descriptor(app):
'',
' .. py:property:: Class.prop',
' :module: target.descriptor',
' :canonical: target.descriptor.prop',
'',
' Property.',
'',
Expand Down
4 changes: 0 additions & 4 deletions tests/test_extensions/test_ext_autodoc_autoclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,23 +219,20 @@ def test_properties(app):
'',
' .. py:property:: Foo.prop1',
' :module: target.properties',
' :canonical: target.properties.prop1',
' :type: int',
'',
' docstring',
'',
'',
' .. py:property:: Foo.prop1_with_type_comment',
' :module: target.properties',
' :canonical: target.properties.prop1_with_type_comment',
' :type: int',
'',
' docstring',
'',
'',
' .. py:property:: Foo.prop2',
' :module: target.properties',
' :canonical: target.properties.prop2',
' :classmethod:',
' :type: int',
'',
Expand All @@ -244,7 +241,6 @@ def test_properties(app):
'',
' .. py:property:: Foo.prop2_with_type_comment',
' :module: target.properties',
' :canonical: target.properties.prop2_with_type_comment',
' :classmethod:',
' :type: int',
'',
Expand Down
4 changes: 0 additions & 4 deletions tests/test_extensions/test_ext_autodoc_autoproperty.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_properties(app):
'',
'.. py:property:: Foo.prop1',
' :module: target.properties',
' :canonical: target.properties.prop1',
' :type: int',
'',
' docstring',
Expand All @@ -33,7 +32,6 @@ def test_class_properties(app):
'',
'.. py:property:: Foo.prop2',
' :module: target.properties',
' :canonical: target.properties.prop2',
' :classmethod:',
' :type: int',
'',
Expand All @@ -51,7 +49,6 @@ def test_properties_with_type_comment(app):
'',
'.. py:property:: Foo.prop1_with_type_comment',
' :module: target.properties',
' :canonical: target.properties.prop1_with_type_comment',
' :type: int',
'',
' docstring',
Expand All @@ -68,7 +65,6 @@ def test_class_properties_with_type_comment(app):
'',
'.. py:property:: Foo.prop2_with_type_comment',
' :module: target.properties',
' :canonical: target.properties.prop2_with_type_comment',
' :classmethod:',
' :type: int',
'',
Expand Down
12 changes: 1 addition & 11 deletions tests/test_extensions/test_ext_autodoc_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ def test_autodoc_inherit_docstrings_for_inherited_members(app):
'',
' .. py:method:: Derived.inheritedclassmeth()',
' :module: target.inheritance',
' :canonical: target.inheritance.Base.inheritedclassmeth',
' :classmethod:',
'',
' Inherited class method.',
' :canonical: target.inheritance.Base.inheritedclassmeth',
'',
'',
' .. py:method:: Derived.inheritedstaticmeth(cls)',
Expand Down Expand Up @@ -425,14 +425,12 @@ def test_autodoc_docstring_signature(app):
'',
' .. py:property:: DocstringSig.prop1',
' :module: target',
' :canonical: target.prop1',
'',
' First line of docstring',
'',
'',
' .. py:property:: DocstringSig.prop2',
' :module: target',
' :canonical: target.prop2',
'',
' First line of docstring',
' Second line of docstring',
Expand Down Expand Up @@ -486,15 +484,13 @@ def test_autodoc_docstring_signature(app):
'',
'',
' .. py:property:: DocstringSig.prop1',
' :canonical: target.prop1',
' :module: target',
'',
' DocstringSig.prop1(self)',
' First line of docstring',
'',
'',
' .. py:property:: DocstringSig.prop2',
' :canonical: target.prop2',
' :module: target',
'',
' First line of docstring',
Expand Down Expand Up @@ -781,13 +777,11 @@ def test_autodoc_typehints_signature(app):
'',
' .. py:property:: Math.path',
' :module: target.typehints',
' :canonical: target.typehints.path',
f' :type: ~{type_ppp}',
'',
'',
' .. py:property:: Math.prop',
' :module: target.typehints',
' :canonical: target.typehints.prop',
' :type: int',
'',
'',
Expand Down Expand Up @@ -908,12 +902,10 @@ def test_autodoc_typehints_none(app):
'',
' .. py:property:: Math.path',
' :module: target.typehints',
' :canonical: target.typehints.path',
'',
'',
' .. py:property:: Math.prop',
' :module: target.typehints',
' :canonical: target.typehints.prop',
'',
'',
'.. py:class:: NewAnnotation(i)',
Expand Down Expand Up @@ -1599,13 +1591,11 @@ def test_autodoc_typehints_format_fully_qualified(app):
'',
' .. py:property:: Math.path',
' :module: target.typehints',
' :canonical: target.typehints.path',
f' :type: {type_ppp}',
'',
'',
' .. py:property:: Math.prop',
' :module: target.typehints',
' :canonical: target.typehints.prop',
' :type: int',
'',
'',
Expand Down
5 changes: 0 additions & 5 deletions tests/test_extensions/test_ext_autodoc_preserve_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,30 @@ def test_preserve_defaults(app):
'',
' .. py:property:: MultiLine.prop1',
' :module: target.preserve_defaults',
' :canonical: target.preserve_defaults.prop1',
'',
' docstring',
'',
'',
' .. py:property:: MultiLine.prop2',
' :module: target.preserve_defaults',
' :canonical: target.preserve_defaults.prop2',
'',
' docstring',
'',
'',
' .. py:property:: MultiLine.prop3',
' :module: target.preserve_defaults',
' :canonical: target.preserve_defaults.prop3',
'',
' docstring',
'',
'',
' .. py:property:: MultiLine.prop4',
' :module: target.preserve_defaults',
' :canonical: target.preserve_defaults.prop4',
'',
' docstring',
'',
'',
' .. py:property:: MultiLine.prop5',
' :module: target.preserve_defaults',
' :canonical: target.preserve_defaults.prop5',
'',
' docstring',
'',
Expand Down

0 comments on commit d691a85

Please sign in to comment.