Skip to content

Commit 22b35ee

Browse files
committed
pytest: Fix warning regarding usefixtures
conftest.py:52 libtmux/conftest.py:52: PytestRemovedIn9Warning: Marks applied to fixtures have no effect See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function def setup( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
1 parent 498405f commit 22b35ee

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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)