Skip to content

Commit 44595f9

Browse files
committed
Fix test_long_term_memory_without_embedding_api_key test
1 parent 48cd2ab commit 44595f9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/test_long_term_memory.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,10 @@ async def test_long_term_memory_without_embedding_api_key(
101101
"Mocked VeFaaS IAM file not found"
102102
)
103103

104-
# In this case, no exception should be raised during initialization,
105-
# as the key is only required when the embedding model is actually used.
106-
try:
107-
LongTermMemory()
108-
except (ValueError, FileNotFoundError) as e:
109-
pytest.fail(f"Initialization failed unexpectedly: {e}")
104+
# In this case, we expect an exception to be raised during initialization
105+
# because the embedding model requires an API key
106+
with pytest.raises((ValueError, FileNotFoundError)):
107+
LongTermMemory(backend="local")
110108

111109
@pytest.mark.asyncio
112110
async def test_long_term_memory_backend_initialization(self):

0 commit comments

Comments
 (0)