parent
043a2da1aa
commit
c34f6df61a
1 changed files with 0 additions and 24 deletions
|
|
@ -1,11 +1,8 @@
|
||||||
import pathlib
|
import pathlib
|
||||||
import os
|
import os
|
||||||
import warnings
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
import cognee
|
import cognee
|
||||||
|
|
||||||
|
|
||||||
from cognee.infrastructure.databases.graph import get_graph_engine
|
from cognee.infrastructure.databases.graph import get_graph_engine
|
||||||
from cognee.infrastructure.databases.vector import get_vector_engine
|
from cognee.infrastructure.databases.vector import get_vector_engine
|
||||||
from cognee.modules.graph.cognee_graph.CogneeGraphElements import Edge
|
from cognee.modules.graph.cognee_graph.CogneeGraphElements import Edge
|
||||||
|
|
@ -49,27 +46,6 @@ async def cleanup_litellm_clients():
|
||||||
pass
|
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():
|
async def setup_test_environment():
|
||||||
"""Helper function to set up test environment with data, cognify, and triplet embeddings."""
|
"""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
|
# This test runs for multiple db settings, to run this locally set the corresponding db envs
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue