Skip to content

Commit 9ed0542

Browse files
authored
Merge pull request #9549 from tk0miya/9524_SphinxTestApp_outdir
Close #9524: test: SphinxTestApp can take ``builddir`` as an argument
2 parents a4a0b97 + 6fb8d1c commit 9ed0542

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Features added
1919
template variable ``sphinx_version_tuple``
2020
* #9445: py domain: ``:py:property:`` directive supports ``:classmethod:``
2121
option to describe the class property
22+
* #9524: test: SphinxTestApp can take ``builddir`` as an argument
2223
* #9535: C and C++, support more fundamental types, including GNU extensions.
2324

2425
Bugs fixed

sphinx/testing/util.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,17 @@ class SphinxTestApp(application.Sphinx):
102102
_status: StringIO = None
103103
_warning: StringIO = None
104104

105-
def __init__(self, buildername: str = 'html', srcdir: path = None, freshenv: bool = False,
106-
confoverrides: Dict = None, status: IO = None, warning: IO = None,
107-
tags: List[str] = None, docutilsconf: str = None, parallel: int = 0) -> None:
105+
def __init__(self, buildername: str = 'html', srcdir: path = None, builddir: path = None,
106+
freshenv: bool = False, confoverrides: Dict = None, status: IO = None,
107+
warning: IO = None, tags: List[str] = None, docutilsconf: str = None,
108+
parallel: int = 0) -> None:
108109

109110
if docutilsconf is not None:
110111
(srcdir / 'docutils.conf').write_text(docutilsconf)
111112

112-
builddir = srcdir / '_build'
113+
if builddir is None:
114+
builddir = srcdir / '_build'
115+
113116
confdir = srcdir
114117
outdir = builddir.joinpath(buildername)
115118
outdir.makedirs(exist_ok=True)

0 commit comments

Comments
 (0)