From b066f9a83cdbc76210f97d983b293e96f5a393e0 Mon Sep 17 00:00:00 2001 From: Daniele Martinoli Date: Mon, 17 Mar 2025 19:32:45 +0100 Subject: [PATCH] with new_event_loop Signed-off-by: Daniele Martinoli --- tests/unit/providers/vector_io/test_qdrant.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/unit/providers/vector_io/test_qdrant.py b/tests/unit/providers/vector_io/test_qdrant.py index 0ebb7503e..bc97719c0 100644 --- a/tests/unit/providers/vector_io/test_qdrant.py +++ b/tests/unit/providers/vector_io/test_qdrant.py @@ -4,6 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +import asyncio import os from typing import Any from unittest.mock import AsyncMock, MagicMock, patch @@ -39,7 +40,9 @@ def qdrant_config(tmp_path) -> InlineQdrantVectorIOConfig: return InlineQdrantVectorIOConfig(path=os.path.join(tmp_path, "qdrant.db")) -import pytest +@pytest.fixture(scope="session") +def loop(): + return asyncio.new_event_loop() @pytest.fixture @@ -65,7 +68,7 @@ def mock_api_service(sample_embeddings): @pytest_asyncio.fixture -async def qdrant_adapter(qdrant_config, mock_vector_db_store, mock_api_service) -> QdrantVectorIOAdapter: +async def qdrant_adapter(qdrant_config, mock_vector_db_store, mock_api_service, loop) -> QdrantVectorIOAdapter: adapter = QdrantVectorIOAdapter(config=qdrant_config, inference_api=mock_api_service) adapter.vector_db_store = mock_vector_db_store await adapter.initialize()