[fix] Fix CI issues with CUDA dependencies and linting

- Mock CUDA-dependent modules in tests to avoid CI failures on CPU-only runners
- Fix ruff linting issues for code style compliance
This commit is contained in:
bymyself 2025-06-01 00:11:00 -07:00
parent ff8f1539c2
commit 97b089dc95
2 changed files with 72 additions and 69 deletions

View File

@ -1,12 +1,15 @@
import pytest
import torch import torch
import sys import sys
import os import os
from unittest.mock import patch
# Add the project root to Python path # Add the project root to Python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..')) sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
from comfy_extras.nodes_images import ImageStitch # Mock CUDA-dependent modules to avoid CI failures
with patch('comfy.model_management.get_torch_device', return_value=torch.device('cpu')):
with patch('comfy.model_management.get_total_memory', return_value=8192):
from comfy_extras.nodes_images import ImageStitch
class TestImageStitch: class TestImageStitch: