mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
refactor: Add extract_summary() for easily testing
This commit is contained in:
@@ -9,14 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
from six import iteritems, StringIO
|
||||
|
||||
from sphinx.ext.autosummary import mangle_signature, import_by_name
|
||||
|
||||
from sphinx.ext.autosummary import mangle_signature, import_by_name, extract_summary
|
||||
from sphinx.testing.util import etree_parse
|
||||
|
||||
import pytest
|
||||
|
||||
html_warnfile = StringIO()
|
||||
|
||||
|
||||
@@ -57,6 +55,14 @@ def test_mangle_signature():
|
||||
assert res == outp, (u"'%s' -> '%s' != '%s'" % (inp, res, outp))
|
||||
|
||||
|
||||
def test_extract_summary():
|
||||
doc = ['',
|
||||
'This is a first sentence. And second one.',
|
||||
'',
|
||||
'Second block is here']
|
||||
assert extract_summary(doc) == 'This is a first sentence.'
|
||||
|
||||
|
||||
@pytest.mark.sphinx('dummy', **default_kw)
|
||||
def test_get_items_summary(make_app, app_params):
|
||||
import sphinx.ext.autosummary
|
||||
|
||||
Reference in New Issue
Block a user