Skip to content

Commit 0ebe2bc

Browse files
committed
pytest: Fix warning
See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function @pytest.fixture(autouse=True, scope="session")
1 parent 60c883e commit 0ebe2bc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

conftest.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,15 @@ def cwd_default(monkeypatch: pytest.MonkeyPatch, tmp_path: pathlib.Path) -> None
4444
monkeypatch.chdir(tmp_path)
4545

4646

47-
@pytest.fixture(autouse=True, scope="session")
48-
@pytest.mark.usefixtures("set_home")
49-
def xdg_config_path(user_path: pathlib.Path) -> pathlib.Path:
47+
@pytest.fixture(autouse=True)
48+
def xdg_config_path(
49+
user_path: pathlib.Path,
50+
set_home: pathlib.Path,
51+
) -> pathlib.Path:
5052
"""Create and return path to use for XDG Config Path."""
5153
p = user_path / ".config"
52-
p.mkdir()
54+
if not p.exists():
55+
p.mkdir()
5356
return p
5457

5558

0 commit comments

Comments
 (0)