From a63bedfd5fcbf9fc4eb64f3b29bffac7f782b148 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 27 Oct 2026 10:34:48 +0000 Subject: [PATCH] Tests: route tests get stand-in model files so a machine without models still sees a deleted file; optional-slot list follows the two LTX presets Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01BzJLJWVu7RZnbRqm3nYAnX --- core/tests/test_routes_ltx_project.py | 2 +- core/tests/test_routes_pipeline.py | 17 ++++++++++++++++- modules/models/tests/test_optional_slots.py | 5 +++-- .../noise_merge/tests/test_through_the_app.py | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/core/tests/test_routes_ltx_project.py b/core/tests/test_routes_ltx_project.py index 1399230d..2782b2d6 100644 --- a/core/tests/test_routes_ltx_project.py +++ b/core/tests/test_routes_ltx_project.py @@ -4,7 +4,7 @@ and for a render. Each must answer JSON: a page that gets anything else fails on import pytest -from core.tests.test_routes_pipeline import _request, registered, server # noqa: F401 +from core.tests.test_routes_pipeline import _request, model_files, registered, server # noqa: F401 def _preset(pid): diff --git a/core/tests/test_routes_pipeline.py b/core/tests/test_routes_pipeline.py index 4e4b400f..70f876d2 100644 --- a/core/tests/test_routes_pipeline.py +++ b/core/tests/test_routes_pipeline.py @@ -20,7 +20,22 @@ from core import routes # noqa: E402 @pytest.fixture(scope="module") -def registered(comfyui): +def model_files(comfyui, tmp_path_factory): + """One empty file in each folder a default loader reads, so the loaders' dropdowns have something to offer. + + A machine without models (a cloud test run) would otherwise report "nothing fills it" for every loader, and a + test that deletes ONE file could not tell its own problem from that. The nodes read their options when they + register, so this comes before `registered`.""" + import folder_paths + root = tmp_path_factory.mktemp("models") + for kind in ("diffusion_models", "vae", "text_encoders", "clip", "loras"): + (root / kind).mkdir() + (root / kind / "stand-in.safetensors").write_bytes(b"\0") + folder_paths.add_model_folder_path(kind, str(root / kind)) + + +@pytest.fixture(scope="module") +def registered(comfyui, model_files): """FunUI's nodes registered the way ComfyUI registers them. Without this the pipeline's slots all look like missing nodes, because the diff --git a/modules/models/tests/test_optional_slots.py b/modules/models/tests/test_optional_slots.py index ba11249b..83d4436f 100644 --- a/modules/models/tests/test_optional_slots.py +++ b/modules/models/tests/test_optional_slots.py @@ -44,10 +44,11 @@ def _cases(): return [(preset["id"], slot["id"]) for preset in _presets() for slot in preset["slots"] if slot["node"] in table] -def test_the_seven_optional_node_classes_are_declared(): +def test_the_optional_node_classes_the_presets_use_are_declared(): + # FunUIIdentityTransfer is still declared (LTX pipelines saved with it keep running) but no preset carries it any more. nodes = {s["node"] for p in _presets() for s in p["slots"] if s["node"] in _table()} assert nodes == {"FunUIEnhancePrompt", "FunUIShotCamera", "FunUIPromptMarkup", "FunUIApplyPromptMarkup", - "FunUINegativeErase", "FunUICutOpening", "FunUIIdentityTransfer"} + "FunUINegativeErase", "FunUICutOpening"} @pytest.mark.parametrize("preset_id,slot_id", _cases()) diff --git a/modules/sampling/noise_merge/tests/test_through_the_app.py b/modules/sampling/noise_merge/tests/test_through_the_app.py index 27e868af..f3ef2dd5 100644 --- a/modules/sampling/noise_merge/tests/test_through_the_app.py +++ b/modules/sampling/noise_merge/tests/test_through_the_app.py @@ -13,7 +13,7 @@ import torch pytest.importorskip("aiohttp") -from core.tests.test_routes_pipeline import _request, registered, server # noqa: E402,F401 +from core.tests.test_routes_pipeline import _request, model_files, registered, server # noqa: E402,F401 @pytest.fixture(autouse=True)