diff --git a/pyproject.toml b/pyproject.toml index 5de46a4e8..4020cfb96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -222,7 +222,6 @@ ignore = [ "PLW0603", # using the global statement to update variables is discouraged "PLW2901", # outer loop variable overwritten by inner assignment # flake8-pytest-style - "PT003", # `scope='function'` is implied in `@pytest.fixture()` "PT011", # `pytest.raises(ValueError)` is too broad, set the `match` parameter # flake8-use-pathlib "PTH", diff --git a/sphinx/testing/fixtures.py b/sphinx/testing/fixtures.py index d8335fd6a..2eab98ead 100644 --- a/sphinx/testing/fixtures.py +++ b/sphinx/testing/fixtures.py @@ -126,7 +126,7 @@ def test_params(request: Any) -> dict: return result -@pytest.fixture(scope='function') +@pytest.fixture() def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable, shared_result: SharedResult) -> Generator[SphinxTestApp, None, None]: """ @@ -147,7 +147,7 @@ def app(test_params: dict, app_params: tuple[dict, dict], make_app: Callable, shared_result.store(test_params['shared_result'], app_) -@pytest.fixture(scope='function') +@pytest.fixture() def status(app: SphinxTestApp) -> StringIO: """ Back-compatibility for testing with previous @with_app decorator @@ -155,7 +155,7 @@ def status(app: SphinxTestApp) -> StringIO: return app._status -@pytest.fixture(scope='function') +@pytest.fixture() def warning(app: SphinxTestApp) -> StringIO: """ Back-compatibility for testing with previous @with_app decorator diff --git a/tests/test_ext_autosummary.py b/tests/test_ext_autosummary.py index 93cf195af..43f3ae00c 100644 --- a/tests/test_ext_autosummary.py +++ b/tests/test_ext_autosummary.py @@ -44,7 +44,7 @@ default_kw = { } -@pytest.fixture(scope='function', autouse=True) +@pytest.fixture(autouse=True) def _unload_target_module(): sys.modules.pop('target', None)