Restore support for `cut_lines()` with no object type (#13015)

This commit is contained in:
Adam Turner
2024-10-12 23:14:24 +01:00
committed by GitHub
parent 5ae32ce9bf
commit 62e9606d63
3 changed files with 30 additions and 3 deletions

View File

@@ -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']))