Skip to content

Commit

Permalink
chore(tests[session]): pydocstyle manual fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Nov 25, 2023
1 parent 071295c commit f5528e8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def test_set_show_option(session: Session) -> None:


def test_empty_session_option_returns_None(session: Session) -> None:
"""Verify Session.show_option returns None for unset option."""
assert session.show_option("default-shell") is None


Expand Down Expand Up @@ -215,6 +216,8 @@ def test_unset_environment(session: Session) -> None:


class PeriodRaisesBadSessionName(t.NamedTuple):
"""Test fixture for bad session name names."""

session_name: str
raises: bool

Expand All @@ -227,9 +230,10 @@ class PeriodRaisesBadSessionName(t.NamedTuple):
PeriodRaisesBadSessionName("hey moo", False),
],
)
def test_periods_raise_badsessionname(
def test_periods_raise_bad_session_name(
server: Server, session: Session, session_name: str, raises: bool
) -> None:
"""Verify session names with periods raise BadSessionName."""
new_name = session_name + "moo" # used for rename / switch
if raises:
with pytest.raises(exc.BadSessionName):
Expand All @@ -256,6 +260,7 @@ def test_periods_raise_badsessionname(


def test_cmd_inserts_session_id(session: Session) -> None:
"""Verify Session.cmd() inserts session_id."""
current_session_id = session.session_id
last_arg = "last-arg"
cmd = session.cmd("not-a-command", last_arg)
Expand All @@ -279,6 +284,7 @@ def test_new_window_with_environment(
session: Session,
environment: t.Dict[str, str],
) -> None:
"""Verify new window with environment vars."""
env = shutil.which("env")
assert env is not None, "Cannot find usable `env` in PATH."

Expand All @@ -303,6 +309,7 @@ def test_new_window_with_environment_logs_warning_for_old_tmux(
session: Session,
caplog: pytest.LogCaptureFixture,
) -> None:
"""Verify new window with environment vars create a warning if tmux is too old."""
env = shutil.which("env")
assert env is not None, "Cannot find usable `env` in PATH."

Expand Down

0 comments on commit f5528e8

Please sign in to comment.