Repository: tmux-python/tmuxp (language: python)

Issue:
pyproject(ruff): Add pydocstyle rule selector w/ numpy convention
# Appendix

- https://www.pydocstyle.org/en/stable/
- https://docs.astral.sh/ruff/settings/#pydocstyle


Discussion / hints:

Fix patch:
diff --git a/CHANGES b/CHANGES
index b071f11ef9..17416adea7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -33,6 +33,10 @@ $ pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force
 
 - libtmux: 0.24.0 -> 0.24.1 (maintenance release)
 
+### Tests
+
+- Shell tests: Use named, typed test fixture (#893)
+
 ## tmuxp 1.32.0 (2023-11-19)
 
 _Maintenance only, no bug fixes or new features_


Test patch:
diff --git a/tests/cli/test_shell.py b/tests/cli/test_shell.py
index d4d9a7cb62..75658471df 100644
--- a/tests/cli/test_shell.py
+++ b/tests/cli/test_shell.py
@@ -11,81 +11,105 @@
 from tmuxp import cli, exc
 
 
-@pytest.mark.parametrize("cli_cmd", [["shell"], ["shell", "--pdb"]])
-@pytest.mark.parametrize(
-    "cli_args,inputs,env,expected_output",
-    [
-        (
-            ["-L{SOCKET_NAME}", "-c", "print(str(server.socket_name))"],
-            [],
-            {},
-            "{SERVER_SOCKET_NAME}",
-        ),
-        (
-            [
-                "-L{SOCKET_NAME}",
-                "{SESSION_NAME}",
-                "-c",
-                "print(session.name)",
-            ],
-            [],
-            {},
+class CLIShellFixture(t.NamedTuple):
+    """Test fixture for tmuxp shell tests."""
+
+    # pytest (internal): Test fixture name
+    test_id: str
+
+    # test params
+    cli_args: t.List[str]
+    inputs: t.List[t.Any]
+    env: t.Dict[str, str]
+    expected_output: str
+
+
+TEST_SHELL_FIXTURES: t.List[CLIShellFixture] = [
+    CLIShellFixture(
+        test_id="print-socket-name",
+        cli_args=["-L{SOCKET_NAME}", "-c", "print(str(server.socket_name))"],
+        inputs=[],
+        env={},
+        expected_output="{SERVER_SOCKET_NAME}",
+    ),
+    CLIShellFixture(
+        test_id="print-session-name",
+        cli_args=[
+            "-L{SOCKET_NAME}",
+            "{SESSION_NAME}",
+            "-c",
+            "print(session.name)",
+        ],
+        inputs=[],
+        env={},
+        expected_output="{SESSION_NAME}",
+    ),
+    CLIShellFixture(
+        test_id="print-has-session",
+        cli_args=[
+            "-L{SOCKET_NAME}",
             "{SESSION_NAME}",
-        ),
-        (
-            [
-                "-L{SOCKET_NAME}",
-                "{SESSION_NAME}",
-                "{WINDOW_NAME}",
-                "-c",
-                "print(server.has_session(session.name))",
-            ],
-            [],
-            {},
-            "True",
-        ),
-        (
-            [
-                "-L{SOCKET_NAME}",
-                "{SESSION_NAME}",
-                "{WINDOW_NAME}",
-                "-c",
-                "print(window.name)",
-            ],
-            [],
-            {},
             "{WINDOW_NAME}",
-        ),
-        (
-            [
-                "-L{SOCKET_NAME}",
-                "{SESSION_NAME}",
-                "{WINDOW_NAME}",
-                "-c",
-                "print(pane.id)",
-            ],
-            [],
-            {},
-            "{PANE_ID}",
-        ),
-        (
-            [
-                "-L{SOCKET_NAME}",
-                "-c",
-                "print(pane.id)",
-            ],
-            [],
-            {"TMUX_PANE": "{PANE_ID}"},
-            "{PANE_ID}",
-        ),
-    ],
+            "-c",
+            "print(server.has_session(session.name))",
+        ],
+        inputs=[],
+        env={},
+        expected_output="True",
+    ),
+    CLIShellFixture(
+        test_id="print-window-name",
+        cli_args=[
+            "-L{SOCKET_NAME}",
+            "{SESSION_NAME}",
+            "{WINDOW_NAME}",
+            "-c",
+            "print(window.name)",
+        ],
+        inputs=[],
+        env={},
+        expected_output="{WINDOW_NAME}",
+    ),
+    CLIShellFixture(
+        test_id="print-pane-id",
+        cli_args=[
+            "-L{SOCKET_NAME}",
+            "{SESSION_NAME}",
+            "{WINDOW_NAME}",
+            "-c",
+            "print(pane.id)",
+        ],
+        inputs=[],
+        env={},
+        expected_output="{PANE_ID}",
+    ),
+    CLIShellFixture(
+        test_id="print-pane-id-obeys-tmux-pane-env-var",
+        cli_args=[
+            "-L{SOCKET_NAME}",
+            "-c",
+            "print(pane.id)",
+        ],
+        inputs=[],
+        env={"TMUX_PANE": "{PANE_ID}"},
+        expected_output="{PANE_ID}",
+    ),
+]
+
+
+@pytest.mark.parametrize("cli_cmd", [["shell"], ["shell", "--pdb"]])
+@pytest.mark.parametrize(
+    list(CLIShellFixture._fields),
+    TEST_SHELL_FIXTURES,
+    ids=[test.test_id for test in TEST_SHELL_FIXTURES],
 )
 def test_shell(
     cli_cmd: t.List[str],
+    test_id: str,
     cli_args: t.List[str],
     inputs: t.List[t.Any],
-    expected_output: str,
     env: t.Dict[str, str],
+    expected_output: str,
     server: "Server",
     session: Session,
     tmp_path: pathlib.Path,