diff --git a/.github/workflows/build-pipeline.yml b/.github/workflows/build-pipeline.yml index 1287d3b..a42d292 100644 --- a/.github/workflows/build-pipeline.yml +++ b/.github/workflows/build-pipeline.yml @@ -35,3 +35,4 @@ jobs: - name: Run Tests run: | pytest tests/ + working-directory: ./ diff --git a/pyproject.toml b/pyproject.toml index e669584..3270a79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,14 +46,15 @@ Icon = "" minversion = "8.0" pythonpath = [ "src", - "../..", # Path to parent directory containing comfy module + #"../..", # Path to parent directory containing comfy module "." ] testpaths = [ "tests", ] #python_files = ["test_*.py"] -python_files = ["conftest.py", "test_boolean_nodes.py"] +#python_files = ["conftest.py", "test_boolean_nodes.py"] +python_files = ["test_boolean_nodes.py"] [tool.mypy] files = "." diff --git a/tests/conftest.py b/tests/conftest.py index e4d9d2c..4d2bbbb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,36 +1,36 @@ -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__), '..'))) - -print("=======================================================================") -print("Mocking 'comfy.comfy_types.node_typing' via conftest.py") -print("=======================================================================") - -# 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 - -def mock_execution_blocker(_): - return None - -mock_comfy_execution = MagicMock() -mock_comfy_execution.ExecutionBlocker = mock_execution_blocker -sys.modules["comfy_execution"] = mock_comfy_execution -sys.modules["comfy_execution.graph"] = mock_comfy_execution +# 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__), '..'))) +# +# print("=======================================================================") +# print("Mocking 'comfy.comfy_types.node_typing' via conftest.py") +# print("=======================================================================") +# +# # 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 +# +# def mock_execution_blocker(_): +# return None +# +# mock_comfy_execution = MagicMock() +# mock_comfy_execution.ExecutionBlocker = mock_execution_blocker +# sys.modules["comfy_execution"] = mock_comfy_execution +# sys.modules["comfy_execution.graph"] = mock_comfy_execution