summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-02-18 12:09:24 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-02-19 14:42:19 +0900
commitd40db5efa260efbecdbd7cf3d8b86d3de7280b10 (patch)
tree52d76597ab6572a03aa88eeb49e49b0a4093deca /tests
parent20613edc033a3c193f4a1fda5f93b7b28ad8bb12 (diff)
downloadsphinx-git-d40db5efa260efbecdbd7cf3d8b86d3de7280b10.tar.gz
Fix #4563: autosummary: Incorrect end of line punctuation detection
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ext_autosummary.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/test_ext_autosummary.py b/tests/test_ext_autosummary.py
index 11ee442d2..f9e217801 100644
--- a/tests/test_ext_autosummary.py
+++ b/tests/test_ext_autosummary.py
@@ -56,11 +56,26 @@ def test_mangle_signature():
def test_extract_summary():
+ from sphinx.util.docutils import new_document
+ from mock import Mock
+ settings = Mock(language_code='',
+ id_prefix='',
+ auto_id_prefix='',
+ pep_reference=False,
+ rfc_reference=False)
+ document = new_document('', settings)
+
+ # normal case
doc = ['',
'This is a first sentence. And second one.',
'',
'Second block is here']
- assert extract_summary(doc) == 'This is a first sentence.'
+ assert extract_summary(doc, document) == 'This is a first sentence.'
+
+ # inliner case
+ doc = ['This sentence contains *emphasis text having dots.*,',
+ 'it does not break sentence.']
+ assert extract_summary(doc, document) == ' '.join(doc)
@pytest.mark.sphinx('dummy', **default_kw)
@@ -101,7 +116,7 @@ def test_get_items_summary(make_app, app_params):
expected_values = {
'withSentence': 'I have a sentence which spans multiple lines.',
- 'noSentence': "this doesn't start with a",
+ 'noSentence': "this doesn't start with a capital.",
'emptyLine': "This is the real summary",
'module_attr': 'This is a module attribute',
'C.class_attr': 'This is a class attribute',