mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Avoid duplicate calls to autodoc-process-docstring (#4198)
This commit is contained in:
parent
e015ce2a0f
commit
db415ba05c
@ -325,7 +325,7 @@ class Autosummary(Directive):
|
||||
# -- Grab the summary
|
||||
|
||||
documenter.add_content(None)
|
||||
doc = list(documenter.process_doc([self.result.data]))
|
||||
doc = self.result.data
|
||||
|
||||
while doc and not doc[0].strip():
|
||||
doc.pop(0)
|
||||
|
@ -73,6 +73,10 @@ def test_get_items_summary(app, status, warning):
|
||||
|
||||
def handler(app, what, name, obj, options, lines):
|
||||
assert isinstance(lines, list)
|
||||
|
||||
# ensure no docstring is processed twice:
|
||||
assert 'THIS HAS BEEN HANDLED' not in lines
|
||||
lines.append('THIS HAS BEEN HANDLED')
|
||||
app.connect('autodoc-process-docstring', handler)
|
||||
|
||||
sphinx.ext.autosummary.Autosummary.get_items = new_get_items
|
||||
|
Loading…
Reference in New Issue
Block a user