mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
test: Update testcase for cut_lines()
This commit is contained in:
parent
3f617a4a9b
commit
e274ae87a5
@ -494,17 +494,21 @@ def test_docstring_processing():
|
||||
# docstring processing by event handler
|
||||
assert process('class', 'bar', E) == ['Init docstring', '', '42', '']
|
||||
|
||||
lid = app.connect('autodoc-process-docstring',
|
||||
cut_lines(1, 1, ['function']))
|
||||
|
||||
def f():
|
||||
"""
|
||||
first line
|
||||
second line
|
||||
third line
|
||||
"""
|
||||
assert process('function', 'f', f) == ['second line', '']
|
||||
app.disconnect(lid)
|
||||
@pytest.mark.sphinx('html', testroot='ext-autodoc')
|
||||
def test_cut_lines(app):
|
||||
app.connect('autodoc-process-docstring',
|
||||
cut_lines(2, 2, ['function']))
|
||||
|
||||
actual = do_autodoc(app, 'function', 'target.process_docstring.func')
|
||||
assert list(actual) == [
|
||||
'',
|
||||
'.. py:function:: func()',
|
||||
' :module: target.process_docstring',
|
||||
'',
|
||||
' second line',
|
||||
' '
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='ext-autodoc')
|
||||
|
Loading…
Reference in New Issue
Block a user