refactor(tests): Add strict type hints to fifth batch of test files

This commit is contained in:
2026-02-28 19:24:02 -05:00
parent ee2d6f4234
commit cc806d2cc6
9 changed files with 20 additions and 21 deletions

View File

@@ -5,6 +5,7 @@ import requests
import os
import signal
import sys
from typing import Generator
import os
# Ensure project root is in path
@@ -14,14 +15,14 @@ from api_hook_client import ApiHookClient
import ai_client
@pytest.fixture(autouse=True)
def reset_ai_client() -> None:
def reset_ai_client() -> Generator[None, None, None]:
"""Reset ai_client global state between every test to prevent state pollution."""
ai_client.reset_session()
# Default to a safe model
ai_client.set_provider("gemini", "gemini-2.5-flash-lite")
yield
def kill_process_tree(pid):
def kill_process_tree(pid: int | None) -> None:
"""Robustly kills a process and all its children."""
if pid is None:
return
@@ -41,7 +42,7 @@ def kill_process_tree(pid):
print(f"[Fixture] Error killing process tree {pid}: {e}")
@pytest.fixture(scope="session")
def live_gui() -> None:
def live_gui() -> Generator[tuple[subprocess.Popen, str], None, None]:
"""
Session-scoped fixture that starts gui_2.py with --enable-test-hooks.
"""