Skip to content

Commit

Permalink
Close #9524: test: SphinxTestApp can take builddir as an argument
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Aug 14, 2021
1 parent 29d0205 commit a4b540f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -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

Bugs fixed
----------
Expand Down
11 changes: 7 additions & 4 deletions sphinx/testing/util.py
Expand Up @@ -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)
Expand Down

0 comments on commit a4b540f

Please sign in to comment.