mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #617: Fix docstring preparation without included signature: only ignore indentation of one line, not two.
This commit is contained in:
@@ -518,6 +518,12 @@ def test_generate():
|
||||
'test_autodoc.DocstringSig.meth')
|
||||
assert_result_contains(
|
||||
' rest of docstring', 'method', 'test_autodoc.DocstringSig.meth')
|
||||
assert_result_contains(
|
||||
'.. py:method:: DocstringSig.meth2()', 'method',
|
||||
'test_autodoc.DocstringSig.meth2')
|
||||
assert_result_contains(
|
||||
' indented line', 'method',
|
||||
'test_autodoc.DocstringSig.meth2')
|
||||
assert_result_contains(
|
||||
'.. py:classmethod:: Class.moore(a, e, f) -> happiness', 'method',
|
||||
'test_autodoc.Class.moore')
|
||||
@@ -660,6 +666,13 @@ First line of docstring
|
||||
rest of docstring
|
||||
"""
|
||||
|
||||
def meth2(self):
|
||||
"""First line, no signature
|
||||
Second line followed by indentation::
|
||||
|
||||
indented line
|
||||
"""
|
||||
|
||||
class StrRepr(str):
|
||||
def __repr__(self):
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user