Tests only run in places where torchaudio is installed

This commit is contained in:
Benjamin Berman 2024-07-19 20:46:38 -07:00 committed by GitHub
parent adfee7d14d
commit b16c6b0390
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -448,6 +448,12 @@ async def test_workflow(workflow_name: str, workflow: dict, has_gpu: bool, clien
if not has_gpu:
pytest.skip("requires gpu")
if "audio" in workflow_name:
try:
import torchaudio
except (ImportError, ModuleNotFoundError):
pytest.skip("requires torchaudio")
prompt = Prompt.validate(workflow)
add_known_models("loras", KNOWN_LORAS, CivitFile(13941, 16576, "epi_noiseoffset2.safetensors"))
# todo: add all the models we want to test a bit more elegantly