diff --git a/sphinx/testing/fixtures.py b/sphinx/testing/fixtures.py index 6af8e0223..8e6fe36b3 100644 --- a/sphinx/testing/fixtures.py +++ b/sphinx/testing/fixtures.py @@ -55,7 +55,7 @@ class SharedResult: } -@pytest.fixture +@pytest.fixture() def app_params(request: Any, test_params: dict, shared_result: SharedResult, sphinx_test_tempdir: str, rootdir: str) -> tuple[dict, dict]: """ @@ -98,7 +98,7 @@ def app_params(request: Any, test_params: dict, shared_result: SharedResult, return namedtuple('app_params', 'args,kwargs')(args, kwargs) # type: ignore -@pytest.fixture +@pytest.fixture() def test_params(request: Any) -> dict: """ Test parameters that are specified by 'pytest.mark.test_params' @@ -187,7 +187,7 @@ def make_app(test_params: dict, monkeypatch: Any) -> Generator[Callable, None, N app_.cleanup() -@pytest.fixture +@pytest.fixture() def shared_result() -> SharedResult: return SharedResult() @@ -197,7 +197,7 @@ def _shared_result_cache() -> None: SharedResult.cache.clear() -@pytest.fixture +@pytest.fixture() def if_graphviz_found(app: SphinxTestApp) -> None: """ The test will be skipped when using 'if_graphviz_found' fixture and graphviz @@ -223,7 +223,7 @@ def sphinx_test_tempdir(tmpdir_factory: Any) -> util.path: return util.path(tmpdir).abspath() -@pytest.fixture +@pytest.fixture() def tempdir(tmpdir: str) -> util.path: """ Temporary directory wrapped with `path` class. @@ -232,7 +232,7 @@ def tempdir(tmpdir: str) -> util.path: return util.path(tmpdir) -@pytest.fixture +@pytest.fixture() def rollback_sysmodules(): """ Rollback sys.modules to its value before testing to unload modules diff --git a/tests/test_build.py b/tests/test_build.py index 77211bb4d..f3a48a3bd 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -16,7 +16,7 @@ def request_session_head(url, **kwargs): return response -@pytest.fixture +@pytest.fixture() def nonascii_srcdir(request, rootdir, sphinx_test_tempdir): # Build in a non-ASCII source dir test_name = '\u65e5\u672c\u8a9e' diff --git a/tests/test_catalogs.py b/tests/test_catalogs.py index 74aa7077a..0e75e8b35 100644 --- a/tests/test_catalogs.py +++ b/tests/test_catalogs.py @@ -6,7 +6,7 @@ import pytest from sphinx.testing.util import find_files -@pytest.fixture +@pytest.fixture() def setup_test(app_params): srcdir = app_params.kwargs['srcdir'] src_locale_dir = srcdir / 'xx' / 'LC_MESSAGES' diff --git a/tests/test_config.py b/tests/test_config.py index 900fc1984..42b91ab69 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -153,7 +153,7 @@ def test_errors_if_setup_is_not_callable(tempdir, make_app): assert 'callable' in str(excinfo.value) -@pytest.fixture +@pytest.fixture() def make_app_with_empty_project(make_app, tempdir): (tempdir / 'conf.py').write_text('', encoding='utf8') diff --git a/tests/test_ext_apidoc.py b/tests/test_ext_apidoc.py index 75208b0d5..4276d5128 100644 --- a/tests/test_ext_apidoc.py +++ b/tests/test_ext_apidoc.py @@ -20,7 +20,7 @@ def apidoc(rootdir, tempdir, apidoc_params): return namedtuple('apidoc', 'coderoot,outdir')(coderoot, outdir) -@pytest.fixture +@pytest.fixture() def apidoc_params(request): pargs = {} kwargs = {} diff --git a/tests/test_ext_imgconverter.py b/tests/test_ext_imgconverter.py index 5132390cf..9af917052 100644 --- a/tests/test_ext_imgconverter.py +++ b/tests/test_ext_imgconverter.py @@ -5,7 +5,7 @@ import subprocess import pytest -@pytest.fixture +@pytest.fixture() def if_converter_found(app): image_converter = getattr(app.config, 'image_converter', '') try: diff --git a/tests/test_markup.py b/tests/test_markup.py index ecc540fcf..01e3dd8ff 100644 --- a/tests/test_markup.py +++ b/tests/test_markup.py @@ -20,7 +20,7 @@ from sphinx.writers.html import HTML5Translator, HTMLWriter from sphinx.writers.latex import LaTeXTranslator, LaTeXWriter -@pytest.fixture +@pytest.fixture() def settings(app): texescape.init() # otherwise done by the latex builder with warnings.catch_warnings(): @@ -41,7 +41,7 @@ def settings(app): domain_context.disable() -@pytest.fixture +@pytest.fixture() def new_document(settings): def create(): document = utils.new_document('test data', settings) @@ -51,14 +51,14 @@ def new_document(settings): return create -@pytest.fixture +@pytest.fixture() def inliner(new_document): document = new_document() document.reporter.get_source_and_line = lambda line=1: ('dummy.rst', line) return Struct(document=document, reporter=document.reporter) -@pytest.fixture +@pytest.fixture() def parse(new_document): def parse_(rst): document = new_document() @@ -89,7 +89,7 @@ class ForgivingLaTeXTranslator(LaTeXTranslator, ForgivingTranslator): pass -@pytest.fixture +@pytest.fixture() def verify_re_html(app, parse): def verify(rst, html_expected): document = parse(rst) @@ -101,7 +101,7 @@ def verify_re_html(app, parse): return verify -@pytest.fixture +@pytest.fixture() def verify_re_latex(app, parse): def verify(rst, latex_expected): document = parse(rst) @@ -116,7 +116,7 @@ def verify_re_latex(app, parse): return verify -@pytest.fixture +@pytest.fixture() def verify_re(verify_re_html, verify_re_latex): def verify_re_(rst, html_expected, latex_expected): if html_expected: @@ -126,7 +126,7 @@ def verify_re(verify_re_html, verify_re_latex): return verify_re_ -@pytest.fixture +@pytest.fixture() def verify(verify_re_html, verify_re_latex): def verify_(rst, html_expected, latex_expected): if html_expected: @@ -136,7 +136,7 @@ def verify(verify_re_html, verify_re_latex): return verify_ -@pytest.fixture +@pytest.fixture() def get_verifier(verify, verify_re): v = { 'verify': verify, diff --git a/tests/test_setup_command.py b/tests/test_setup_command.py index 510515125..3f1ed6752 100644 --- a/tests/test_setup_command.py +++ b/tests/test_setup_command.py @@ -12,7 +12,7 @@ import sphinx from sphinx.util.osutil import cd -@pytest.fixture +@pytest.fixture() def setup_command(request, tempdir, rootdir): """ Run `setup.py build_sphinx` with args and kwargs, @@ -65,7 +65,7 @@ def test_build_sphinx_multiple_invalid_builders(setup_command): assert proc.returncode == 1 -@pytest.fixture +@pytest.fixture() def nonascii_srcdir(request, setup_command): mb_name = '\u65e5\u672c\u8a9e' srcdir = (setup_command.pkgroot / 'doc')