diff --git a/CHANGES b/CHANGES index e95bfa8fc..f040a346e 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,10 @@ $ pip install --user --upgrade --pre libtmux +### Tests + +- pytest: Fix `usefixture` warning (#519) + ## libtmux 0.27.1 (2024-02-07) ### Packaging diff --git a/conftest.py b/conftest.py index 876090be4..3f7bc577b 100644 --- a/conftest.py +++ b/conftest.py @@ -47,12 +47,19 @@ def set_home( monkeypatch.setenv("HOME", str(user_path)) +@pytest.fixture(autouse=True, scope="function") +def setup_fn( + clear_env: None, +) -> None: + """Function-level test configuration fixtures for pytest.""" + pass + + @pytest.fixture(autouse=True, scope="session") -@pytest.mark.usefixtures("clear_env") -def setup( +def setup_session( request: pytest.FixtureRequest, config_file: pathlib.Path, ) -> None: - """Configure test fixtures for pytest.""" + """Session-level test configuration for pytest.""" if USING_ZSH: request.getfixturevalue("zshrc")