Fix PT003 (implied `scope='function'`)

This commit is contained in:
Adam Turner 2023-07-28 07:04:35 +01:00
parent fb5b80c340
commit 78976662d9
3 changed files with 4 additions and 5 deletions

View File

@ -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",

View File

@ -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

View File

@ -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)