Skip to content

Commit b907890

Browse files
committed
More autogenerated types
1 parent fe3e169 commit b907890

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

tests/test_util.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for utility functions in tmux."""
22
import pytest
3+
from libtmux.server import Server
34

45
from tmuxp import exc
56
from tmuxp.exc import BeforeLoadScriptError, BeforeLoadScriptNotExists
@@ -8,7 +9,7 @@
89
from .constants import FIXTURE_PATH
910

1011

11-
def test_raise_BeforeLoadScriptNotExists_if_not_exists():
12+
def test_raise_BeforeLoadScriptNotExists_if_not_exists() -> None:
1213
script_file = FIXTURE_PATH / "script_noexists.sh"
1314

1415
with pytest.raises(BeforeLoadScriptNotExists):
@@ -18,38 +19,40 @@ def test_raise_BeforeLoadScriptNotExists_if_not_exists():
1819
run_before_script(script_file)
1920

2021

21-
def test_raise_BeforeLoadScriptError_if_retcode():
22+
def test_raise_BeforeLoadScriptError_if_retcode() -> None:
2223
script_file = FIXTURE_PATH / "script_failed.sh"
2324

2425
with pytest.raises(BeforeLoadScriptError):
2526
run_before_script(script_file)
2627

2728

28-
def test_return_stdout_if_ok(capsys: pytest.CaptureFixture[str]):
29+
def test_return_stdout_if_ok(capsys: pytest.CaptureFixture[str]) -> None:
2930
script_file = FIXTURE_PATH / "script_complete.sh"
3031

3132
run_before_script(script_file)
3233
out, err = capsys.readouterr()
3334
assert "hello" in out
3435

3536

36-
def test_beforeload_returncode():
37+
def test_beforeload_returncode() -> None:
3738
script_file = FIXTURE_PATH / "script_failed.sh"
3839

3940
with pytest.raises(exc.BeforeLoadScriptError) as excinfo:
4041
run_before_script(script_file)
4142
assert excinfo.match(r"113")
4243

4344

44-
def test_beforeload_returns_stderr_messages():
45+
def test_beforeload_returns_stderr_messages() -> None:
4546
script_file = FIXTURE_PATH / "script_failed.sh"
4647

4748
with pytest.raises(exc.BeforeLoadScriptError) as excinfo:
4849
run_before_script(script_file)
4950
assert excinfo.match(r"failed with returncode")
5051

5152

52-
def test_get_session_should_default_to_local_attached_session(server, monkeypatch):
53+
def test_get_session_should_default_to_local_attached_session(
54+
server: Server, monkeypatch: pytest.MonkeyPatch
55+
) -> None:
5356
server.new_session(session_name="myfirstsession")
5457
second_session = server.new_session(session_name="mysecondsession")
5558

@@ -60,7 +63,9 @@ def test_get_session_should_default_to_local_attached_session(server, monkeypatc
6063
assert get_session(server) == second_session
6164

6265

63-
def test_get_session_should_return_first_session_if_no_active_session(server):
66+
def test_get_session_should_return_first_session_if_no_active_session(
67+
server: Server,
68+
) -> None:
6469
first_session = server.new_session(session_name="myfirstsession")
6570
server.new_session(session_name="mysecondsession")
6671

0 commit comments

Comments
 (0)