From f70f0ec13f509877937e8c2243b4bf1442aea755 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 15 Jun 2018 13:07:14 -0400 Subject: [PATCH] FIX for sphinx 1.8.0 dev (#391) --- .gitignore | 1 + sphinx_gallery/tests/test_full.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6a1cb61ff..153632169 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ htmlcov/ nosetests.xml coverage.xml *.orig +.pytest_cache # Translations *.mo diff --git a/sphinx_gallery/tests/test_full.py b/sphinx_gallery/tests/test_full.py index 9bea6b29d..5d7e0fd10 100644 --- a/sphinx_gallery/tests/test_full.py +++ b/sphinx_gallery/tests/test_full.py @@ -12,6 +12,7 @@ import shutil from sphinx.application import Sphinx +from sphinx.util.docutils import docutils_namespace import pytest @@ -31,7 +32,12 @@ def ignore(src, names): conf_dir = temp_dir out_dir = op.join(temp_dir, '_build', 'html') toctrees_dir = op.join(temp_dir, '_build', 'toctrees') - app = Sphinx(src_dir, conf_dir, out_dir, toctrees_dir, buildername='html') + # Avoid warnings about re-registration, see: + # https://github.com/sphinx-doc/sphinx/issues/5038 + with docutils_namespace(): + app = Sphinx(src_dir, conf_dir, out_dir, toctrees_dir, + buildername='html') + app.build(False, []) return app