Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Check for multiple exception types #859

davidmezzetti986da4700a96
diff --git a/test/python/testvectors/testwordvectors.py b/test/python/testvectors/testwordvectors.py
index 74d82c01..8abf9adb 100644
--- a/test/python/testvectors/testwordvectors.py
+++ b/test/python/testvectors/testwordvectors.py
@@ -10,6 +10,7 @@ from unittest.mock import patch
import numpy as np
+from huggingface_hub.errors import HFValidationError
from txtai.vectors import VectorsFactory
@@ -135,7 +136,7 @@ class TestWordVectors(unittest.TestCase):
"""
# Test non-existent path raises an exception
- with self.assertRaises(IOError):
+ with self.assertRaises((IOError, HFValidationError)):
VectorsFactory.create({"method": "words", "path": os.path.join(tempfile.gettempdir(), "noexist")}, None)
def testTransform(self):