summaryrefslogtreecommitdiff
path: root/tests/test_autosummary.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_autosummary.py')
-rw-r--r--tests/test_autosummary.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_autosummary.py b/tests/test_autosummary.py
index e6018e3d7..de26a0546 100644
--- a/tests/test_autosummary.py
+++ b/tests/test_autosummary.py
@@ -10,11 +10,14 @@
"""
import sys
from functools import wraps
+from StringIO import StringIO
from sphinx.ext.autosummary import mangle_signature
from util import test_roots, TestApp
+html_warnfile = StringIO()
+
def with_autosummary_app(*args, **kw):
default_kw = {
@@ -75,7 +78,7 @@ def test_mangle_signature():
assert res == outp, (u"'%s' -> '%s' != '%s'" % (inp, res, outp))
-@with_autosummary_app(buildername='html')
+@with_autosummary_app(buildername='html', warning=html_warnfile)
def test_get_items_summary(app):
app.builddir.rmtree(True)
@@ -98,6 +101,9 @@ def test_get_items_summary(app):
finally:
sphinx.ext.autosummary.Autosummary.get_items = orig_get_items
+ html_warnings = html_warnfile.getvalue()
+ assert html_warnings == ''
+
expected_values = {
'withSentence': 'I have a sentence which spans multiple lines.',
'noSentence': "this doesn't start with a",
@@ -106,6 +112,7 @@ def test_get_items_summary(app):
'C.class_attr': 'This is a class attribute',
'C.prop_attr1': 'This is a function docstring',
'C.prop_attr2': 'This is a attribute docstring',
+ 'C.C2': 'This is a nested inner class docstring',
}
for key, expected in expected_values.iteritems():
assert autosummary_items[key][2] == expected, 'Summary for %s was %r -'\