mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix PT003 (implied `scope='function'
`)
This commit is contained in:
parent
fb5b80c340
commit
78976662d9
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user