From 691f5d88c2aa1ddd6edd838e4abe8883bd6f4068 Mon Sep 17 00:00:00 2001 From: Victor Kuznetsov Date: Mon, 3 Aug 2026 12:23:21 -0700 Subject: [PATCH] Skip the face-stage dtype guard without the qwen-zimage extra CI's base test job installs the library without that extra, so the test died on `import transformers` before reaching a single assertion. It monkeypatches the Z-Image and SAM loaders rather than calling them, but the modules still have to be importable to be patched, so pytest.importorskip is the right gate: the guard still runs everywhere the extra is present and skips where it cannot. Local runs could not have caught this - the dev environment has the extra. Co-Authored-By: Claude Opus 5 --- tests/test_qwen_zimage_pipeline.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_qwen_zimage_pipeline.py b/tests/test_qwen_zimage_pipeline.py index c8d4ae8..cf46079 100644 --- a/tests/test_qwen_zimage_pipeline.py +++ b/tests/test_qwen_zimage_pipeline.py @@ -203,8 +203,12 @@ def test_face_stage_loads_in_its_own_dtype_when_the_global_stage_differs(monkeyp consistently-wrong value. """ import torch - import transformers - from diffsynth.pipelines import z_image + + # The loaders this asserts on are monkeypatched, not called, but the modules still + # have to be importable to be patched -- and CI's base job installs the library + # without the qwen-zimage extra. + transformers = pytest.importorskip("transformers") + z_image = pytest.importorskip("diffsynth.pipelines.z_image") from remove_ai_watermarks._internal.sdxl_zimage_pipeline import SdxlZImagePipeline