Skip to content

Commit 91251e5

Browse files
committed
test(conftest): Start using some libtmux pytest plugin fixtures
1 parent 6cff1ee commit 91251e5

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

tmuxp/conftest.py

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import getpass
21
import logging
32
import os
43
import pathlib
@@ -22,18 +21,6 @@
2221
USING_ZSH = "zsh" in os.getenv("SHELL", "")
2322

2423

25-
@pytest.fixture(autouse=True, scope="session")
26-
def home_path(tmp_path_factory: pytest.TempPathFactory):
27-
return tmp_path_factory.mktemp("home")
28-
29-
30-
@pytest.fixture(autouse=True, scope="session")
31-
def user_path(home_path: pathlib.Path):
32-
p = home_path / getpass.getuser()
33-
p.mkdir()
34-
return p
35-
36-
3724
@pytest.mark.skipif(USING_ZSH, reason="Using ZSH")
3825
@pytest.fixture(autouse=USING_ZSH, scope="session")
3926
def zshrc(user_path: pathlib.Path):
@@ -47,8 +34,8 @@ def zshrc(user_path: pathlib.Path):
4734

4835

4936
@pytest.fixture(autouse=True)
50-
def home_path_default(user_path: pathlib.Path):
51-
os.environ["HOME"] = str(user_path)
37+
def home_path_default(monkeypatch: pytest.MonkeyPatch, user_path: pathlib.Path) -> None:
38+
monkeypatch.setenv("HOME", str(user_path))
5239

5340

5441
@pytest.fixture(scope="function")

0 commit comments

Comments
 (0)