Skip to content

Commit

Permalink
Check for multiple exception types #859
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmezzetti committed Jan 27, 2025
1 parent 5887f5f commit 986da47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/python/testvectors/testwordvectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import numpy as np

from huggingface_hub.errors import HFValidationError
from txtai.vectors import VectorsFactory


Expand Down Expand Up @@ -135,7 +136,7 @@ def testNoExist(self):
"""

# 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):
Expand Down

0 comments on commit 986da47

Please sign in to comment.