Skip to content

Commit 5424ecd

Browse files
committed
tests: If ZSH is the shell, stub out zshrc to prevent default message
1 parent 2e19a9b commit 5424ecd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/conftest.py

+13
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from libtmux.test import TEST_SESSION_PREFIX, get_test_session_name, namer
1111

1212
logger = logging.getLogger(__name__)
13+
USING_ZSH = "zsh" in os.getenv("SHELL", "")
1314

1415

1516
@pytest.fixture(autouse=True, scope="session")
@@ -24,6 +25,18 @@ def user_path(home_path: pathlib.Path):
2425
return p
2526

2627

28+
@pytest.mark.skipif(USING_ZSH, reason="Using ZSH")
29+
@pytest.fixture(autouse=USING_ZSH, scope="session")
30+
def zshrc(user_path: pathlib.Path):
31+
"""This quiets ZSH default message.
32+
33+
Needs a startup file .zshenv, .zprofile, .zshrc, .zlogin.
34+
"""
35+
p = user_path / ".zshrc"
36+
p.touch()
37+
return p
38+
39+
2740
@pytest.fixture(autouse=True)
2841
def home_path_default(user_path: pathlib.Path):
2942
os.environ["HOME"] = str(user_path)

0 commit comments

Comments
 (0)