mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-06 12:57:06 +08:00
[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:
parent
ff8f1539c2
commit
97b089dc95
@ -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:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user