summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-08-29 23:54:31 +0900
committerGitHub <noreply@github.com>2021-08-29 23:54:31 +0900
commit9ed054279aeffd5b1d0642e2d24a8800389de29f (patch)
tree688aab6d4da780597d781b1dec3b9047f4694a9f
parenta4a0b97835f9622e19b1df098d2ded68a860432a (diff)
parent6fb8d1c806580119b17385b2621dff7b23f1f4c2 (diff)
downloadsphinx-git-9ed054279aeffd5b1d0642e2d24a8800389de29f.tar.gz
Merge pull request #9549 from tk0miya/9524_SphinxTestApp_outdir
Close #9524: test: SphinxTestApp can take ``builddir`` as an argument
-rw-r--r--CHANGES1
-rw-r--r--sphinx/testing/util.py11
2 files changed, 8 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 4006913c1..4e98b2c8a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -19,6 +19,7 @@ Features added
template variable ``sphinx_version_tuple``
* #9445: py domain: ``:py:property:`` directive supports ``:classmethod:``
option to describe the class property
+* #9524: test: SphinxTestApp can take ``builddir`` as an argument
* #9535: C and C++, support more fundamental types, including GNU extensions.
Bugs fixed
diff --git a/sphinx/testing/util.py b/sphinx/testing/util.py
index bfbb1071c..941184fe7 100644
--- a/sphinx/testing/util.py
+++ b/sphinx/testing/util.py
@@ -102,14 +102,17 @@ class SphinxTestApp(application.Sphinx):
_status: StringIO = None
_warning: StringIO = None
- def __init__(self, buildername: str = 'html', srcdir: path = None, freshenv: bool = False,
- confoverrides: Dict = None, status: IO = None, warning: IO = None,
- tags: List[str] = None, docutilsconf: str = None, parallel: int = 0) -> None:
+ def __init__(self, buildername: str = 'html', srcdir: path = None, builddir: path = None,
+ freshenv: bool = False, confoverrides: Dict = None, status: IO = None,
+ warning: IO = None, tags: List[str] = None, docutilsconf: str = None,
+ parallel: int = 0) -> None:
if docutilsconf is not None:
(srcdir / 'docutils.conf').write_text(docutilsconf)
- builddir = srcdir / '_build'
+ if builddir is None:
+ builddir = srcdir / '_build'
+
confdir = srcdir
outdir = builddir.joinpath(buildername)
outdir.makedirs(exist_ok=True)