refactor(tests): Add strict type hints to fifth batch of test files
This commit is contained in:
@@ -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.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user