Revert "Update test_search_db.py"

This reverts commit 043a2da1aa.
This commit is contained in:
hajdul88 2025-12-11 20:47:58 +01:00
parent 043a2da1aa
commit c34f6df61a

View file

@ -1,11 +1,8 @@
import pathlib
import os
import warnings
import pytest
import pytest_asyncio
import cognee
from cognee.infrastructure.databases.graph import get_graph_engine
from cognee.infrastructure.databases.vector import get_vector_engine
from cognee.modules.graph.cognee_graph.CogneeGraphElements import Edge
@ -49,27 +46,6 @@ async def cleanup_litellm_clients():
pass
@pytest_asyncio.fixture(scope="session", autouse=True)
async def cleanup_litellm_clients_session():
"""Session-scoped fixture to cleanup LiteLLM clients at the end of all tests.
This ensures cleanup happens before LiteLLM's own cleanup tries to run
during event loop closure, preventing RuntimeWarning in Python 3.10.
"""
yield
# Final cleanup of LiteLLM async clients at session end
try:
import litellm
if hasattr(litellm, "close_litellm_async_clients"):
cleanup_coro = litellm.close_litellm_async_clients()
if cleanup_coro is not None:
await cleanup_coro
except (RuntimeError, Exception):
# Event loop might already be closing, ignore the error
pass
async def setup_test_environment():
"""Helper function to set up test environment with data, cognify, and triplet embeddings."""
# This test runs for multiple db settings, to run this locally set the corresponding db envs