Fix broken unit test caused by non-existent model path.

This commit is contained in:
Ryan Dick 2024-07-10 13:59:17 -04:00
parent 7b5d4935b4
commit 650902dc29

View File

@ -256,6 +256,12 @@ class ModelProbe(object):
return ModelType.SpandrelImageToImage
except spandrel.UnsupportedModelError:
pass
except RuntimeError as e:
if "No such file or directory" in str(e):
# This error is expected if the model_path does not exist (which is the case in some unit tests).
pass
else:
raise e
raise InvalidModelConfigException(f"Unable to determine model type for {model_path}")