From b77ce572948c438efc49067fb923c98efbd2d263 Mon Sep 17 00:00:00 2001 From: Amna Mubashar Date: Sat, 14 Dec 2024 21:58:11 +0100 Subject: [PATCH] change log to print --- integrations/azure_ai_search/tests/conftest.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/integrations/azure_ai_search/tests/conftest.py b/integrations/azure_ai_search/tests/conftest.py index 471eccbd4..02742031c 100644 --- a/integrations/azure_ai_search/tests/conftest.py +++ b/integrations/azure_ai_search/tests/conftest.py @@ -6,13 +6,10 @@ from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import ResourceNotFoundError from azure.search.documents.indexes import SearchIndexClient -from haystack import logging from haystack.document_stores.types import DuplicatePolicy from haystack_integrations.document_stores.azure_ai_search import AzureAISearchDocumentStore -logger = logging.getLogger(__name__) - # This is the approximate time in seconds it takes for the documents to be available in Azure Search index SLEEP_TIME_IN_SECONDS = 10 @@ -78,11 +75,11 @@ def wait_for_index_deletion(client, index_name): try: client.delete_index(index_name) if not wait_for_index_deletion(client, index_name): - logger.error(f"Index {index_name} was not properly deleted.") + print(f"Index {index_name} was not properly deleted.") except ResourceNotFoundError: - logger.error(f"Index {index_name} was already deleted or not found.") + print(f"Index {index_name} was already deleted or not found.") except Exception as e: - logger.error(f"Unexpected error when deleting index {index_name}: {e}") + print(f"Unexpected error when deleting index {index_name}: {e}") raise @@ -100,11 +97,10 @@ def cleanup_indexes(): yield # Allow tests to run before performing cleanup # Cleanup: Delete all remaining indexes - logger.info("Starting session-level cleanup of all Azure Search indexes.") + print("Starting session-level cleanup of all Azure Search indexes.") existing_indexes = client.list_index_names() for index in existing_indexes: try: - logger.info(f"Deleting leftover index: {index}") client.delete_index(index) except Exception as e: - logger.error(f"Failed to delete index {index}: {e}") + print(f"Failed to delete index during clean up {index}: {e}")