Skip to content

Commit 571679c

Browse files
Explicitly scope the fixtures
Contravenes PT003 but "Explicit is better than implicit." Co-authored-by: Paddy Roddy <[email protected]>
1 parent 1df49a4 commit 571679c

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

tests/conftest.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88

99

10-
@pytest.fixture
10+
@pytest.fixture(scope="function") # noqa: PT003
1111
def default_config() -> dict[str, str]:
1212
"""
1313
Get the minimal default configuration for cutting a cookie in tests.
@@ -22,7 +22,7 @@ def default_config() -> dict[str, str]:
2222
}
2323

2424

25-
@pytest.fixture
25+
@pytest.fixture(scope="function") # noqa: PT003
2626
def default_config_with(default_config: dict[str, str]) -> typing.Callable:
2727
"""Extend or modify the default configuration with one additional value."""
2828

@@ -33,8 +33,7 @@ def _wrapped_with(**kwargs: str) -> dict[str, str]:
3333

3434

3535
def _generate_package(
36-
config: dict[str, str],
37-
path: pathlib.Path,
36+
config: dict[str, str], path: pathlib.Path
3837
) -> tuple[subprocess.CompletedProcess[str], pathlib.Path]:
3938
"""
4039
Generate a project from the cookiecutter template.
@@ -66,8 +65,7 @@ def _generate_package(
6665

6766
@pytest.fixture
6867
def generate_package(
69-
default_config: dict[str, str],
70-
tmp_path: pathlib.Path,
68+
default_config: dict[str, str], tmp_path: pathlib.Path
7169
) -> typing.Callable:
7270
"""Generate project from cookiecutter template."""
7371

0 commit comments

Comments
 (0)