test: distinguish real-Core integration from standalone CI
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
import importlib.util
|
||||
import sys
|
||||
from pathlib import Path
|
||||
@@ -27,6 +28,17 @@ import subprocess
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def require_comfy_core():
|
||||
"""Only skip integration cases when the standalone checkout lacks Core."""
|
||||
try:
|
||||
importlib.import_module("comfy")
|
||||
except ModuleNotFoundError as error:
|
||||
if error.name != "comfy":
|
||||
raise
|
||||
pytest.skip("Requires an installed ComfyUI Core; standalone CI has no Core")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def review_queue_results():
|
||||
node = shutil.which("node")
|
||||
|
||||
@@ -12,7 +12,9 @@ def group(keyframe):
|
||||
|
||||
@pytest.mark.parametrize('resize',[False,True])
|
||||
@pytest.mark.parametrize('kind',['audio','video','mixed'])
|
||||
def test_modalities_preserve_audio_and_frozen_source(kind,resize):
|
||||
def test_modalities_preserve_audio_and_frozen_source(kind,resize,request):
|
||||
if resize and kind!='audio':
|
||||
request.getfixturevalue('require_comfy_core')
|
||||
keyframe={'resolved_frame_index':0}
|
||||
if kind!='video': keyframe['audio_latent']=torch.arange(32*2*7).reshape(1,32,2,7).float()
|
||||
if kind!='audio': keyframe['latent']=torch.ones(1,24,1,2,3)
|
||||
|
||||
@@ -131,7 +131,7 @@ def test_signature_failure_is_diagnostic_not_a_generation_stop():
|
||||
assert contract and not safe and reasons
|
||||
|
||||
|
||||
def test_core_euler_sampler_has_an_observable_runtime_signature():
|
||||
def test_core_euler_sampler_has_an_observable_runtime_signature(require_comfy_core):
|
||||
from comfy.samplers import sampler_object
|
||||
_, safe = storage._sampler_signature(sampler_object("euler"))
|
||||
assert safe
|
||||
|
||||
@@ -19,7 +19,7 @@ def test_equal_rate_returns_original_without_importing_a_resampler(monkeypatch):
|
||||
|
||||
@pytest.mark.parametrize("rate", [16000, 22050, 32000, 44100, 48000, 96000])
|
||||
@pytest.mark.parametrize("channels", [1, 2])
|
||||
def test_resample_is_exactly_core(rate, channels):
|
||||
def test_resample_is_exactly_core(rate, channels, require_comfy_core):
|
||||
from comfy.audio import resample
|
||||
waveform = torch.sin(torch.arange(rate // 10, dtype=torch.float32) * 0.0123).view(1, 1, -1).repeat(1, channels, 1)
|
||||
frozen = waveform.clone()
|
||||
@@ -75,7 +75,7 @@ def test_errors_never_switch_silently_to_a_different_resampler(monkeypatch, fail
|
||||
|
||||
|
||||
@pytest.mark.parametrize("rate", [32000, 44100, 48000])
|
||||
def test_reference_bundle_and_driving_do_not_require_torchaudio(rate, monkeypatch):
|
||||
def test_reference_bundle_and_driving_do_not_require_torchaudio(rate, monkeypatch, require_comfy_core):
|
||||
original_import = builtins.__import__
|
||||
def no_torchaudio(name, *args, **kwargs):
|
||||
if name == "torchaudio" or name.startswith("torchaudio."):
|
||||
|
||||
Reference in New Issue
Block a user