summaryrefslogtreecommitdiff
path: root/tests/test_autodoc.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-03-22 17:55:32 +0900
committerGitHub <noreply@github.com>2020-03-22 17:55:32 +0900
commit91a22a3ecc733e981a6d96acfabae70d796533cb (patch)
tree603c74d621f0cfbe53ab34684d087ab549c5d286 /tests/test_autodoc.py
parenta6c1cc2ace448dcb27b704be09284b276870f598 (diff)
parent9ebad705b8dd5edbeca92622e65deb62cbe13e26 (diff)
downloadsphinx-git-91a22a3ecc733e981a6d96acfabae70d796533cb.tar.gz
Merge pull request #7358 from tk0miya/refactor_autodoc
refactor: autodoc: Remove needless spaces from blank line
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r--tests/test_autodoc.py320
1 files changed, 160 insertions, 160 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index b6323a46f..012292999 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -361,7 +361,7 @@ def test_new_documenter(app):
' :module: target',
'',
' documentation for the integer',
- ' '
+ '',
]
@@ -420,7 +420,7 @@ def test_py_module(app, warning):
' :module: target',
'',
' Function.',
- ' '
+ '',
]
assert ("don't know which module to import for autodocumenting 'Class.meth'"
not in warning.getvalue())
@@ -435,7 +435,7 @@ def test_autodoc_decorator(app):
' :module: target.decorator',
'',
' docstring for deco1',
- ' '
+ '',
]
actual = do_autodoc(app, 'decorator', 'target.decorator.deco2')
@@ -445,7 +445,7 @@ def test_autodoc_decorator(app):
' :module: target.decorator',
'',
' docstring for deco2',
- ' '
+ '',
]
@@ -458,7 +458,7 @@ def test_autodoc_exception(app):
' :module: target',
'',
' My custom exception.',
- ' '
+ '',
]
@@ -726,7 +726,7 @@ def test_autodoc_subclass_of_builtin_class(app):
' :module: target',
'',
' Docstring.',
- ' '
+ '',
]
@@ -740,23 +740,23 @@ def test_autodoc_inner_class(app):
' :module: target',
'',
' Foo',
- ' ',
- ' ',
+ '',
+ '',
' .. py:class:: Outer.Inner',
' :module: target',
- ' ',
+ '',
' Foo',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Outer.Inner.meth()',
' :module: target',
- ' ',
+ '',
' Foo',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: Outer.factory',
' :module: target',
- ' ',
+ '',
' alias of :class:`builtins.dict`'
]
@@ -767,13 +767,13 @@ def test_autodoc_inner_class(app):
' :module: target.Outer',
'',
' Foo',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Inner.meth()',
' :module: target.Outer',
- ' ',
+ '',
' Foo',
- ' ',
+ '',
]
options['show-inheritance'] = True
@@ -785,7 +785,7 @@ def test_autodoc_inner_class(app):
' Bases: :class:`target.Outer.Inner`',
'',
' InnerChild docstring',
- ' '
+ '',
]
@@ -799,7 +799,7 @@ def test_autodoc_classmethod(app):
' :classmethod:',
'',
' Inherited class method.',
- ' '
+ '',
]
@@ -813,7 +813,7 @@ def test_autodoc_staticmethod(app):
' :staticmethod:',
'',
' Inherited static method.',
- ' '
+ '',
]
@@ -827,19 +827,19 @@ def test_autodoc_descriptor(app):
'.. py:class:: Class',
' :module: target.descriptor',
'',
- ' ',
+ '',
' .. py:attribute:: Class.descr',
' :module: target.descriptor',
- ' ',
+ '',
' Descriptor instance docstring.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Class.prop',
' :module: target.descriptor',
' :property:',
- ' ',
+ '',
' Property.',
- ' '
+ ''
]
@@ -854,7 +854,7 @@ def test_autodoc_c_module(app):
" Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.",
' When the time tuple is not present, current time as returned by localtime()',
' is used.',
- ' '
+ '',
]
@@ -946,7 +946,7 @@ def test_autodoc_module_scope(app):
' :value: <_io.StringIO object>',
'',
' should be documented as well - süß',
- ' '
+ '',
]
@@ -962,7 +962,7 @@ def test_autodoc_class_scope(app):
' :value: <_io.StringIO object>',
'',
' should be documented as well - süß',
- ' '
+ '',
]
@@ -976,16 +976,16 @@ def test_class_attributes(app):
'.. py:class:: AttCls',
' :module: target',
'',
- ' ',
+ '',
' .. py:attribute:: AttCls.a1',
' :module: target',
' :value: hello world',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: AttCls.a2',
' :module: target',
' :value: None',
- ' '
+ ''
]
@@ -999,43 +999,43 @@ def test_instance_attributes(app):
' :module: target',
'',
' Class with documented class and instance attributes.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: InstAttCls.ca1',
' :module: target',
" :value: 'a'",
- ' ',
+ '',
' Doc comment for class attribute InstAttCls.ca1.',
' It can have multiple lines.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: InstAttCls.ca2',
' :module: target',
" :value: 'b'",
- ' ',
+ '',
' Doc comment for InstAttCls.ca2. One line only.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: InstAttCls.ca3',
' :module: target',
" :value: 'c'",
- ' ',
+ '',
' Docstring for class attribute InstAttCls.ca3.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: InstAttCls.ia1',
' :module: target',
' :value: None',
- ' ',
+ '',
' Doc comment for instance attribute InstAttCls.ia1',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: InstAttCls.ia2',
' :module: target',
' :value: None',
- ' ',
+ '',
' Docstring for instance attribute InstAttCls.ia2.',
- ' '
+ ''
]
# pick up arbitrary attributes
@@ -1047,22 +1047,22 @@ def test_instance_attributes(app):
' :module: target',
'',
' Class with documented class and instance attributes.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: InstAttCls.ca1',
' :module: target',
" :value: 'a'",
- ' ',
+ '',
' Doc comment for class attribute InstAttCls.ca1.',
' It can have multiple lines.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: InstAttCls.ia1',
' :module: target',
' :value: None',
- ' ',
+ '',
' Doc comment for instance attribute InstAttCls.ia1',
- ' '
+ ''
]
@@ -1079,30 +1079,30 @@ def test_slots(app):
'.. py:class:: Bar()',
' :module: target.slots',
'',
- ' ',
+ '',
' .. py:attribute:: Bar.attr1',
' :module: target.slots',
- ' ',
+ '',
' docstring of attr1',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: Bar.attr2',
' :module: target.slots',
- ' ',
+ '',
' docstring of instance attr2',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: Bar.attr3',
' :module: target.slots',
- ' ',
+ '',
'',
'.. py:class:: Foo',
' :module: target.slots',
'',
- ' ',
+ '',
' .. py:attribute:: Foo.attr',
' :module: target.slots',
- ' ',
+ '',
]
@@ -1117,39 +1117,39 @@ def test_enum_class(app):
' :module: target.enum',
'',
' this is enum class',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: EnumCls.say_hello()',
' :module: target.enum',
- ' ',
+ '',
' a method says hello to you.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: EnumCls.val1',
' :module: target.enum',
' :value: 12',
- ' ',
+ '',
' doc for val1',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: EnumCls.val2',
' :module: target.enum',
' :value: 23',
- ' ',
+ '',
' doc for val2',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: EnumCls.val3',
' :module: target.enum',
' :value: 34',
- ' ',
+ '',
' doc for val3',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: EnumCls.val4',
' :module: target.enum',
' :value: 34',
- ' '
+ ''
]
# checks for an attribute of EnumClass
@@ -1161,7 +1161,7 @@ def test_enum_class(app):
' :value: 12',
'',
' doc for val1',
- ' '
+ ''
]
@@ -1178,19 +1178,19 @@ def test_descriptor_class(app):
' :module: target.descriptor',
'',
' Descriptor class docstring.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: CustomDataDescriptor.meth()',
' :module: target.descriptor',
- ' ',
+ '',
' Function.',
- ' ',
+ '',
'',
'.. py:class:: CustomDataDescriptor2(doc)',
' :module: target.descriptor',
'',
' Descriptor class with custom metaclass docstring.',
- ' '
+ '',
]
@@ -1203,7 +1203,7 @@ def test_autofunction_for_callable(app):
' :module: target.callable',
'',
' A callable object that behaves like a function.',
- ' '
+ '',
]
@@ -1216,7 +1216,7 @@ def test_autofunction_for_method(app):
' :module: target.callable',
'',
' docstring of Callable.method().',
- ' '
+ '',
]
@@ -1233,39 +1233,39 @@ def test_abstractmethods():
'.. py:class:: Base',
' :module: target.abstractmethods',
'',
- ' ',
+ '',
' .. py:method:: Base.abstractmeth()',
' :module: target.abstractmethods',
' :abstractmethod:',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Base.classmeth()',
' :module: target.abstractmethods',
' :abstractmethod:',
' :classmethod:',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Base.coroutinemeth()',
' :module: target.abstractmethods',
' :abstractmethod:',
' :async:',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Base.meth()',
' :module: target.abstractmethods',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Base.prop',
' :module: target.abstractmethods',
' :abstractmethod:',
' :property:',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Base.staticmeth()',
' :module: target.abstractmethods',
' :abstractmethod:',
' :staticmethod:',
- ' '
+ '',
]
@@ -1282,25 +1282,25 @@ def test_partialfunction():
' :module: target.partialfunction',
'',
' docstring of func1',
- ' ',
+ '',
'',
'.. py:function:: func2(b, c)',
' :module: target.partialfunction',
'',
' docstring of func1',
- ' ',
+ '',
'',
'.. py:function:: func3(c)',
' :module: target.partialfunction',
'',
' docstring of func3',
- ' ',
+ '',
'',
'.. py:function:: func4()',
' :module: target.partialfunction',
'',
' docstring of func3',
- ' '
+ '',
]
@@ -1328,7 +1328,7 @@ def test_bound_method():
' :module: target.bound_method',
'',
' Method docstring',
- ' ',
+ '',
]
@@ -1350,29 +1350,29 @@ def test_coroutine():
'.. py:class:: AsyncClass',
' :module: target.coroutine',
'',
- ' ',
+ '',
' .. py:method:: AsyncClass.do_coroutine()',
' :module: target.coroutine',
' :async:',
- ' ',
+ '',
' A documented coroutine function',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: AsyncClass.do_coroutine2()',
' :module: target.coroutine',
' :async:',
' :classmethod:',
- ' ',
+ '',
' A documented coroutine classmethod',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: AsyncClass.do_coroutine3()',
' :module: target.coroutine',
' :async:',
' :staticmethod:',
- ' ',
+ '',
' A documented coroutine staticmethod',
- ' ',
+ '',
]
@@ -1384,21 +1384,21 @@ def test_partialmethod(app):
' :module: target.partialmethod',
'',
' An example for partialmethod.',
- ' ',
+ '',
' refs: https://docs.python.jp/3/library/functools.html#functools.partialmethod',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Cell.set_alive()',
' :module: target.partialmethod',
- ' ',
+ '',
' Make a cell alive.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Cell.set_state(state)',
' :module: target.partialmethod',
- ' ',
+ '',
' Update state of cell to *state*.',
- ' ',
+ '',
]
options = {"members": None}
@@ -1414,25 +1414,25 @@ def test_partialmethod_undoc_members(app):
' :module: target.partialmethod',
'',
' An example for partialmethod.',
- ' ',
+ '',
' refs: https://docs.python.jp/3/library/functools.html#functools.partialmethod',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Cell.set_alive()',
' :module: target.partialmethod',
- ' ',
+ '',
' Make a cell alive.',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Cell.set_dead()',
' :module: target.partialmethod',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Cell.set_state(state)',
' :module: target.partialmethod',
- ' ',
+ '',
' Update state of cell to *state*.',
- ' ',
+ '',
]
options = {"members": None,
@@ -1455,48 +1455,48 @@ def test_autodoc_typed_instance_variables(app):
'.. py:class:: Class()',
' :module: target.typed_vars',
'',
- ' ',
+ '',
' .. py:attribute:: Class.attr1',
' :module: target.typed_vars',
' :type: int',
' :value: 0',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: Class.attr2',
' :module: target.typed_vars',
' :type: int',
' :value: None',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: Class.attr3',
' :module: target.typed_vars',
' :type: int',
' :value: 0',
- ' ',
- ' ',
+ '',
+ '',
' .. py:attribute:: Class.attr4',
' :module: target.typed_vars',
' :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',
@@ -1504,7 +1504,7 @@ def test_autodoc_typed_instance_variables(app):
" :value: ''",
'',
' attr1',
- ' ',
+ '',
'',
'.. py:data:: attr2',
' :module: target.typed_vars',
@@ -1512,7 +1512,7 @@ def test_autodoc_typed_instance_variables(app):
' :value: None',
'',
' attr2',
- ' ',
+ '',
'',
'.. py:data:: attr3',
' :module: target.typed_vars',
@@ -1520,7 +1520,7 @@ def test_autodoc_typed_instance_variables(app):
" :value: ''",
'',
' attr3',
- ' '
+ '',
]
@@ -1538,7 +1538,7 @@ def test_autodoc_Annotated(app):
' :module: target.annotated',
'',
' docstring',
- ' '
+ '',
]
@@ -1557,7 +1557,7 @@ def test_autodoc_for_egged_code(app):
' :value: 1',
'',
' constant on sample.py',
- ' ',
+ '',
'',
'.. py:function:: hello(s)',
' :module: sample',
@@ -1580,7 +1580,7 @@ def test_singledispatch():
' :module: target.singledispatch',
'',
' A function for general use.',
- ' '
+ '',
]
@@ -1599,13 +1599,13 @@ def test_singledispatchmethod():
' :module: target.singledispatchmethod',
'',
' docstring',
- ' ',
- ' ',
+ '',
+ '',
' .. py:method:: Foo.meth(arg, kwarg=None)',
' Foo.meth(arg: int, kwarg=None)',
' Foo.meth(arg: str, kwarg=None)',
' :module: target.singledispatchmethod',
- ' ',
+ '',
' A method for general use.',
- ' '
+ '',
]