Fix for Sphinx 1.6

This commit is contained in:
Ashley Whetter 2017-08-28 14:01:14 -07:00 committed by Ashley Whetter
parent 316457e9fc
commit a1a3f05202
3 changed files with 12 additions and 6 deletions

View File

@ -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):

View File

@ -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):

View File

@ -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 =