Fix #3900: autosummary could not find methods

This commit is contained in:
Takeshi KOMIYA
2017-07-02 18:26:41 +09:00
parent 82adedbc56
commit b3e0e29f4c
6 changed files with 48 additions and 1 deletions

View File

@@ -126,3 +126,22 @@ def test_escaping(app, status, warning):
title = etree_parse(docpage).find('section/title')
assert str_content(title) == 'underscore_module_'
@pytest.mark.sphinx('dummy', testroot='ext-autosummary')
def test_autosummary_generate(app, status, warning):
app.builder.build_all()
module = (app.srcdir / 'generated' / 'autodoc_dummy_module.rst').text()
assert (' .. autosummary::\n'
' \n'
' Foo\n'
' \n' in module)
Foo = (app.srcdir / 'generated' / 'autodoc_dummy_module.Foo.rst').text()
assert '.. automethod:: __init__' in Foo
assert (' .. autosummary::\n'
' \n'
' ~Foo.__init__\n'
' ~Foo.bar\n'
' \n' in Foo)