From 302a8f8e066eeeaccbfc95624ffe931d23c5d509 Mon Sep 17 00:00:00 2001 From: StableLlama Date: Sun, 18 May 2025 15:06:27 +0200 Subject: [PATCH] Mock comfy_types in the hope to make the tests work again --- tests/conftest.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 310609c..ea74195 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,24 @@ import os import sys +from unittest.mock import MagicMock # Add the project root directory to Python path # This allows the tests to import the project sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + +# Create a dummy 'comfy.comfy_types.node_typing' module +mock_comfy = MagicMock() +mock_comfy.IO = MagicMock( + BOOLEAN="BOOLEAN", + INT="INT", + FLOAT="FLOAT", + STRING="STRING", + NUMBER = "FLOAT,INT", + ANY="*", +) +mock_comfy.ComfyNodeABC = object + +# Inject the mocked module into sys.modules +sys.modules["comfy"] = mock_comfy +sys.modules["comfy.comfy_types"] = mock_comfy +sys.modules["comfy.comfy_types.node_typing"] = mock_comfy