fix: E2E test fixture scope mismatch
Fix pytest fixture scope incompatibility with pytest-asyncio. Changed fixture scope from "module" to "function" to match pytest-asyncio's default event loop scope. Issue: ScopeMismatch error when accessing function-scoped event loop fixture from module-scoped fixtures. Testing: Fixes E2E test execution in GitHub Actions
This commit is contained in:
parent
c32e6a4e7b
commit
d89849c8a6
2 changed files with 4 additions and 4 deletions
|
|
@ -20,7 +20,7 @@ from lightrag.namespace import NameSpace
|
|||
|
||||
|
||||
# E2E test configuration from environment
|
||||
@pytest.fixture(scope="module")
|
||||
@pytest.fixture(scope="function")
|
||||
def pg_config():
|
||||
"""Real PostgreSQL configuration from environment variables"""
|
||||
return {
|
||||
|
|
@ -34,7 +34,7 @@ def pg_config():
|
|||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
@pytest.fixture(scope="function")
|
||||
async def real_db(pg_config):
|
||||
"""Create a real PostgreSQL database connection"""
|
||||
db = PostgreSQLDB(pg_config)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from qdrant_client.models import Distance, VectorParams
|
|||
|
||||
|
||||
# E2E test configuration from environment
|
||||
@pytest.fixture(scope="module")
|
||||
@pytest.fixture(scope="function")
|
||||
def qdrant_config():
|
||||
"""Real Qdrant configuration from environment variables"""
|
||||
return {
|
||||
|
|
@ -31,7 +31,7 @@ def qdrant_config():
|
|||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
@pytest.fixture(scope="function")
|
||||
def qdrant_client(qdrant_config):
|
||||
"""Create a real Qdrant client"""
|
||||
client = QdrantClient(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue