Skip to content

Commit 45aa960

Browse files
removing async test for non-existant model (#9208)
1 parent bac29d9 commit 45aa960

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

test/components/embedders/test_hugging_face_api_text_embedder.py

-25
Original file line numberDiff line numberDiff line change
@@ -317,28 +317,3 @@ async def test_run_async_concurrent_requests(self):
317317
assert isinstance(result["embedding"], list)
318318
assert all(isinstance(x, float) for x in result["embedding"])
319319
assert len(result["embedding"]) == 384 # MiniLM-L6-v2 has 384 dimensions
320-
321-
@pytest.mark.integration
322-
@pytest.mark.asyncio
323-
@pytest.mark.skipif(os.environ.get("HF_API_TOKEN", "") == "", reason="HF_API_TOKEN is not set")
324-
async def test_run_async_error_handling_with_real_api(self):
325-
"""
326-
Integration test that verifies error handling with a real API.
327-
This test requires a valid Hugging Face API token.
328-
"""
329-
# Use an invalid model name to trigger an error
330-
invalid_model_name = "invalid-model-name-that-does-not-exist"
331-
332-
embedder = HuggingFaceAPITextEmbedder(
333-
api_type=HFEmbeddingAPIType.SERVERLESS_INFERENCE_API, api_params={"model": invalid_model_name}
334-
)
335-
336-
# Test with a simple text
337-
text = "This is a test sentence for embedding."
338-
339-
# The request should fail with an appropriate error
340-
with pytest.raises(Exception) as excinfo:
341-
await embedder.run_async(text=text)
342-
343-
# Verify that the error message contains information about the invalid model
344-
assert invalid_model_name in str(excinfo.value) or "model" in str(excinfo.value).lower()

0 commit comments

Comments
 (0)