from pathlib import Path import cv2 as cv import numpy as np import pytest @pytest.fixture def monitor_photo() -> np.ndarray: """A synthetic photo: dark background with one light, square 'display'.""" arr = np.full((600, 800, 3), 30, dtype=np.uint8) cv.rectangle(arr, (300, 200), (500, 400), (200, 200, 200), thickness=-1) return arr @pytest.fixture def monitor_photo_path(tmp_path: Path, monitor_photo: np.ndarray) -> Path: path = tmp_path / "monitor.png" cv.imwrite(str(path), monitor_photo) return path