diff --git a/autoapi/extension.py b/autoapi/extension.py index e4361a8..53f88d3 100644 --- a/autoapi/extension.py +++ b/autoapi/extension.py @@ -135,10 +135,6 @@ def doctree_read(app, doctree): app.info(bold('[AutoAPI] ') + darkgreen('Adding AutoAPI TOCTree [%s] to index.rst' % toc_entry) ) - if sphinx.version_info >= (1, 5): - app.env.toctree.process_doc(app.env.docname, doctree) - else: - app.env.build_toc_from(app.env.docname, doctree) def setup(app): diff --git a/tests/test_integration.py b/tests/test_integration.py index 7415fb2..f5ca600 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -89,6 +89,15 @@ class PythonTests(LanguageIntegrationTests): self.assertFalse( os.path.exists('_build/text/autoapi/method_multiline') ) + index_file = open('_build/text/index.txt').read() + self.assertIn( + 'Sphinx AutoAPI Index', + index_file + ) + self.assertIn( + 'Foo', + index_file + ) class DotNetTests(LanguageIntegrationTests): diff --git a/tox.ini b/tox.ini index ea7dd36..01a0fc8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{27,34,35}-sphinx{13,14,15} + py{27,34,35}-sphinx{13,14,15,16} lint docs @@ -12,12 +12,13 @@ deps = -r{toxinidir}/requirements.txt mock sphinx14: Sphinx<1.5 sphinx15: Sphinx<1.6 + sphinx16: Sphinx<1.7 commands = py.test {posargs} [testenv:docs] deps = - Sphinx==1.5 + Sphinx>=1.6,<=1.7 sphinx_rtd_theme changedir = {toxinidir}/docs commands =