Skip to content

Commit db775fc

Browse files
authored
pytest: Fix warning regarding usefixtures (#519)
2 parents 498405f + 0b3624c commit db775fc

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CHANGES

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ $ pip install --user --upgrade --pre libtmux
1414

1515
<!-- Maintainers and contributors: Insert change notes for the next release above -->
1616

17+
### Tests
18+
19+
- pytest: Fix `usefixture` warning (#519)
20+
1721
## libtmux 0.27.1 (2024-02-07)
1822

1923
### Packaging

conftest.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,19 @@ def set_home(
4747
monkeypatch.setenv("HOME", str(user_path))
4848

4949

50+
@pytest.fixture(autouse=True, scope="function")
51+
def setup_fn(
52+
clear_env: None,
53+
) -> None:
54+
"""Function-level test configuration fixtures for pytest."""
55+
pass
56+
57+
5058
@pytest.fixture(autouse=True, scope="session")
51-
@pytest.mark.usefixtures("clear_env")
52-
def setup(
59+
def setup_session(
5360
request: pytest.FixtureRequest,
5461
config_file: pathlib.Path,
5562
) -> None:
56-
"""Configure test fixtures for pytest."""
63+
"""Session-level test configuration for pytest."""
5764
if USING_ZSH:
5865
request.getfixturevalue("zshrc")

0 commit comments

Comments
 (0)