From 1c6431e8a02f0bda87afbb41fab63c93fda280ad Mon Sep 17 00:00:00 2001 From: "juancarlos.cavero" Date: Thu, 23 Jul 2026 11:40:05 +0200 Subject: [PATCH] =?UTF-8?q?test(ci):=20saltar=20los=20tests=20que=20import?= =?UTF-8?q?an=20main/app=20en=20el=20CI=20m=C3=ADnimo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El CI instala solo pytest+pillow+httpx+pydantic+sqlalchemy. test_gemini_retry importa main (cv2/torch) y test_job_error_text importa app (dotenv/fastapi), que faltan → ModuleNotFoundError en la colección. importorskip los salta en CI y los corre entero en el contenedor/local donde sí están las deps. Verificado en un venv réplica del CI: 125 passed, 2 skipped. --- tests/test_gemini_retry.py | 4 +++- tests/test_job_error_text.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_gemini_retry.py b/tests/test_gemini_retry.py index 5354600..17f09c2 100644 --- a/tests/test_gemini_retry.py +++ b/tests/test_gemini_retry.py @@ -7,7 +7,9 @@ loop and kill the job on the first blip. import types import pytest -import main +# main pulls in cv2/torch/mediapipe at import time; the minimal CI env lacks +# them, so skip there. Runs fully in the container/local where deps exist. +main = pytest.importorskip("main") class _FakeResponse: diff --git a/tests/test_job_error_text.py b/tests/test_job_error_text.py index e60ff90..f6a8de1 100644 --- a/tests/test_job_error_text.py +++ b/tests/test_job_error_text.py @@ -5,7 +5,11 @@ subsystem because the classifier read the tail of the log instead of the error: a Gemini blip was reported as "ffmpeg/render" and a silent upload as a broken download path. """ -import app +import pytest + +# app pulls in dotenv/fastapi/cloud at import time; the minimal CI env lacks +# them, so skip there. Runs fully in the container/local where deps exist. +app = pytest.importorskip("app") from cloud.alerts import _classify_failure