Merge pull request #9549 from tk0miya/9524_SphinxTestApp_outdir

Close #9524: test: SphinxTestApp can take ``builddir`` as an argument
This commit is contained in:
Takeshi KOMIYA 2021-08-29 23:54:31 +09:00 committed by GitHub
commit 9ed054279a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

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

View File

@ -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)
if builddir is None:
builddir = srcdir / '_build'
confdir = srcdir
outdir = builddir.joinpath(buildername)
outdir.makedirs(exist_ok=True)