2016-08-08 22:19:49 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
test_autodoc
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Test the autodoc extension.
|
|
|
|
|
2017-03-22 06:21:12 -05:00
|
|
|
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
|
2016-08-08 22:19:49 -05:00
|
|
|
:license: BSD, see LICENSE for details.
|
|
|
|
"""
|
|
|
|
|
|
|
|
import pickle
|
2017-01-05 10:14:47 -06:00
|
|
|
import pytest
|
2016-08-08 22:19:49 -05:00
|
|
|
from sphinx import addnodes
|
|
|
|
|
|
|
|
|
2017-01-05 10:14:47 -06:00
|
|
|
@pytest.mark.sphinx('dummy', testroot='ext-autodoc')
|
2016-08-08 22:19:49 -05:00
|
|
|
def test_autodoc(app, status, warning):
|
|
|
|
app.builder.build_all()
|
|
|
|
|
|
|
|
content = pickle.loads((app.doctreedir / 'contents.doctree').bytes())
|
|
|
|
assert isinstance(content[3], addnodes.desc)
|
|
|
|
assert content[3][0].astext() == 'autodoc_dummy_module.test'
|
|
|
|
assert content[3][1].astext() == 'Dummy function using dummy.*'
|