mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Migrate to py3 style type annotation: sphinx.testing.fixtures
This commit is contained in:
@@ -14,25 +14,20 @@ import sys
|
||||
from collections import namedtuple
|
||||
from io import StringIO
|
||||
from subprocess import PIPE
|
||||
from typing import Any, Dict
|
||||
|
||||
import pytest
|
||||
|
||||
from . import util
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Union # NOQA
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def rootdir():
|
||||
# type: () -> None
|
||||
def rootdir() -> None:
|
||||
return None
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app_params(request, test_params, shared_result, sphinx_test_tempdir, rootdir):
|
||||
# type: (Any, Any, Any, Any, Any) -> None
|
||||
"""
|
||||
parameters that is specified by 'pytest.mark.sphinx' for
|
||||
sphinx.application.Sphinx initialization
|
||||
@@ -158,10 +153,10 @@ def make_app(test_params, monkeypatch):
|
||||
status, warning = StringIO(), StringIO()
|
||||
kwargs.setdefault('status', status)
|
||||
kwargs.setdefault('warning', warning)
|
||||
app_ = util.SphinxTestApp(*args, **kwargs) # type: Union[util.SphinxTestApp, util.SphinxTestAppWrapperForSkipBuilding] # NOQA
|
||||
app_ = util.SphinxTestApp(*args, **kwargs) # type: Any
|
||||
apps.append(app_)
|
||||
if test_params['shared_result']:
|
||||
app_ = util.SphinxTestAppWrapperForSkipBuilding(app_) # type: ignore
|
||||
app_ = util.SphinxTestAppWrapperForSkipBuilding(app_)
|
||||
return app_
|
||||
yield make
|
||||
|
||||
|
||||
Reference in New Issue
Block a user