test: add pytest verification suite and gitea ci workflow
All checks were successful
CI / test (push) Successful in 48s

This commit is contained in:
Space-Banane
2026-05-27 17:55:34 +02:00
parent 8fe6ad2d75
commit a19b285232
9 changed files with 360 additions and 13 deletions

View File

@@ -18,9 +18,10 @@ from .utils import clamp, draw_global_grid, image_to_data_url, utc_now_iso
try:
import pyautogui
except Exception as import_exc:
raise RuntimeError(
"pyautogui is required. Install dependencies with: pip install pyautogui pillow"
) from import_exc
pyautogui = None # type: ignore[assignment]
_PYAUTOGUI_IMPORT_ERROR = import_exc
else:
_PYAUTOGUI_IMPORT_ERROR = None
SYSTEM_PROMPT = """
@@ -52,6 +53,12 @@ class ScreenJobAgent:
cancel_event: threading.Event | None = None,
event_callback: Callable[[dict[str, Any]], None] | None = None,
) -> None:
if pyautogui is None:
raise RuntimeError(
"pyautogui is required for agent execution. "
"Install dependencies and ensure GUI access. "
f"Import error: {_PYAUTOGUI_IMPORT_ERROR}"
)
self.client = client
self.logger = logger
self.artifacts = artifacts
@@ -784,4 +791,3 @@ class ScreenJobAgent:
usage=self.usage,
error=result_text,
)