From 45aa9608b54497ba7d8f566bd4dceeb6ae658d4e Mon Sep 17 00:00:00 2001 From: "David S. Batista" Date: Thu, 10 Apr 2025 12:38:35 +0200 Subject: [PATCH] removing async test for non-existant model (#9208) --- .../test_hugging_face_api_text_embedder.py | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/test/components/embedders/test_hugging_face_api_text_embedder.py b/test/components/embedders/test_hugging_face_api_text_embedder.py index f5f8aebb6..c5b12207f 100644 --- a/test/components/embedders/test_hugging_face_api_text_embedder.py +++ b/test/components/embedders/test_hugging_face_api_text_embedder.py @@ -317,28 +317,3 @@ class TestHuggingFaceAPITextEmbedderAsync: assert isinstance(result["embedding"], list) assert all(isinstance(x, float) for x in result["embedding"]) assert len(result["embedding"]) == 384 # MiniLM-L6-v2 has 384 dimensions - - @pytest.mark.integration - @pytest.mark.asyncio - @pytest.mark.skipif(os.environ.get("HF_API_TOKEN", "") == "", reason="HF_API_TOKEN is not set") - async def test_run_async_error_handling_with_real_api(self): - """ - Integration test that verifies error handling with a real API. - This test requires a valid Hugging Face API token. - """ - # Use an invalid model name to trigger an error - invalid_model_name = "invalid-model-name-that-does-not-exist" - - embedder = HuggingFaceAPITextEmbedder( - api_type=HFEmbeddingAPIType.SERVERLESS_INFERENCE_API, api_params={"model": invalid_model_name} - ) - - # Test with a simple text - text = "This is a test sentence for embedding." - - # The request should fail with an appropriate error - with pytest.raises(Exception) as excinfo: - await embedder.run_async(text=text) - - # Verify that the error message contains information about the invalid model - assert invalid_model_name in str(excinfo.value) or "model" in str(excinfo.value).lower()