From dea29d0f11450694366b002e57f347effaee52fb Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 6 Apr 2010 13:22:52 +0200 Subject: [PATCH] #374: Make the ``doctest_path`` config value of the doctest extension actually work -- it was used after all tests were run. --- CHANGES | 3 +++ sphinx/ext/doctest.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e6def50b0..f287bba15 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ Release 0.6.6 (in development) ============================== +* #374: Make the ``doctest_path`` config value of the doctest + extension actually work. + * Fix the handling of multiple toctrees when creating the global TOC for the ``toctree()`` template function. diff --git a/sphinx/ext/doctest.py b/sphinx/ext/doctest.py index a424bdfec..9d681f904 100644 --- a/sphinx/ext/doctest.py +++ b/sphinx/ext/doctest.py @@ -196,6 +196,8 @@ class DocTestBuilder(Builder): # that code nevertheless, we monkey-patch the "compile" it uses. doctest.compile = self.compile + sys.path[0:0] = self.config.doctest_path + self.type = 'single' self.total_failures = 0 @@ -246,8 +248,6 @@ Doctest summary if self.total_failures or self.setup_failures: self.app.statuscode = 1 - sys.path[0:0] = self.config.doctest_path - def write(self, build_docnames, updated_docnames, method='update'): if build_docnames is None: build_docnames = sorted(self.env.all_docs)