From 91671a77df4237396dafa6b2ac93ef16d128cb11 Mon Sep 17 00:00:00 2001 From: iomgaa Date: Wed, 29 Jul 2026 23:57:44 -0400 Subject: [PATCH] test: pin OCR live tests to trust_env=false httpx reads the macOS system proxy config (not just env vars) when trust_env is on, and the proxy answers 403 for the LAN service at 10.77.0.20. The raw-httpx case in this file already passed trust_env=False; the OcrClient cases relied on the default and failed on any machine with a system proxy enabled. --- tests/integration/test_monkey_ocr_live.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/integration/test_monkey_ocr_live.py b/tests/integration/test_monkey_ocr_live.py index de8ac75..7ec3a92 100644 --- a/tests/integration/test_monkey_ocr_live.py +++ b/tests/integration/test_monkey_ocr_live.py @@ -46,6 +46,10 @@ def _env(sources: dict[int, str], **extra: str) -> dict[str, str]: f"OCR__MONKEY__{n}__API_KEY": "none", f"OCR__MONKEY__{n}__MODEL": "monkey-ocr", f"OCR__MONKEY__{n}__TIMEOUT_S": "300", + # 服务在 LAN,开发机若开着系统代理(httpx trust_env 读 macOS 系统配置, + # 不是环境变量),代理会对内网地址回 403 —— 与本文件 raw httpx 用例 + # 显式传 trust_env=False 同因 + f"OCR__MONKEY__{n}__TRUST_ENV": "false", } env.update(extra) return env