mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Restore support for `cut_lines()` with no object type (#13015)
This commit is contained in:
@@ -58,6 +58,26 @@ def test_cut_lines(app):
|
||||
]
|
||||
|
||||
|
||||
def test_cut_lines_no_objtype():
|
||||
docstring_lines = [
|
||||
'first line',
|
||||
'---',
|
||||
'second line',
|
||||
'---',
|
||||
'third line ',
|
||||
'',
|
||||
]
|
||||
process = cut_lines(2)
|
||||
|
||||
process(None, 'function', 'func', None, {}, docstring_lines) # type: ignore[arg-type]
|
||||
assert docstring_lines == [
|
||||
'second line',
|
||||
'---',
|
||||
'third line ',
|
||||
'',
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='ext-autodoc')
|
||||
def test_between(app):
|
||||
app.connect('autodoc-process-docstring', between('---', ['function']))
|
||||
|
||||
Reference in New Issue
Block a user