summaryrefslogtreecommitdiff
path: root/sphinx/testing/fixtures.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-04-10 00:32:26 +0900
committerGitHub <noreply@github.com>2021-04-10 00:32:26 +0900
commitfe6d95e4294f47d61f1a04a1f8c6567c9802f504 (patch)
tree33a7143bf1dcf60830c2e1fcd4b396175af45e64 /sphinx/testing/fixtures.py
parent7327e56dff865d4766c43d46405ae827e10fd6c3 (diff)
parentce5d66e618c111b115a9bb7b1401a26483fcfa8f (diff)
downloadsphinx-git-fe6d95e4294f47d61f1a04a1f8c6567c9802f504.tar.gz
Merge branch 'master' into patch-1
Diffstat (limited to 'sphinx/testing/fixtures.py')
-rw-r--r--sphinx/testing/fixtures.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/sphinx/testing/fixtures.py b/sphinx/testing/fixtures.py
index 1cf66283f..729d9a2d7 100644
--- a/sphinx/testing/fixtures.py
+++ b/sphinx/testing/fixtures.py
@@ -8,7 +8,6 @@
:license: BSD, see LICENSE for details.
"""
-import os
import subprocess
import sys
from collections import namedtuple
@@ -42,7 +41,7 @@ def rootdir() -> str:
class SharedResult:
- cache = {} # type: Dict[str, Dict[str, str]]
+ cache: Dict[str, Dict[str, str]] = {}
def store(self, key: str, app_: SphinxTestApp) -> Any:
if key in self.cache:
@@ -78,7 +77,7 @@ def app_params(request: Any, test_params: Dict, shared_result: SharedResult,
else:
markers = request.node.get_marker("sphinx")
pargs = {}
- kwargs = {} # type: Dict[str, Any]
+ kwargs: Dict[str, Any] = {}
if markers is not None:
# to avoid stacking positional args
@@ -90,7 +89,6 @@ def app_params(request: Any, test_params: Dict, shared_result: SharedResult,
args = [pargs[i] for i in sorted(pargs.keys())]
# ##### process pytest.mark.test_params
-
if test_params['shared_result']:
if 'srcdir' in kwargs:
raise pytest.Exception('You can not specify shared_result and '
@@ -192,7 +190,7 @@ def make_app(test_params: Dict, monkeypatch: Any) -> Generator[Callable, None, N
status, warning = StringIO(), StringIO()
kwargs.setdefault('status', status)
kwargs.setdefault('warning', warning)
- app_ = SphinxTestApp(*args, **kwargs) # type: Any
+ app_: Any = SphinxTestApp(*args, **kwargs)
apps.append(app_)
if test_params['shared_result']:
app_ = SphinxTestAppWrapperForSkipBuilding(app_)
@@ -236,10 +234,7 @@ def sphinx_test_tempdir(tmpdir_factory: Any) -> "util.path":
"""
temporary directory that wrapped with `path` class.
"""
- tmpdir = os.environ.get('SPHINX_TEST_TEMPDIR') # RemovedInSphinx40Warning
- if tmpdir is None:
- tmpdir = tmpdir_factory.getbasetemp()
-
+ tmpdir = tmpdir_factory.getbasetemp()
return util.path(tmpdir).abspath()