test(postgres): support multi-session integration tests
Why: - Code under test (auth resolution, the two-phase upload) opens more than one session per operation; the existing fixture only exposed one rolled-back session. Changes: - Add a db_sessionmaker fixture sharing one outer transaction. - Pin loop_scope="session" -- without it, a second async test against the session-scoped Postgres container fails with "Event loop is closed."
This commit is contained in:
@@ -2,7 +2,11 @@ import pytest
|
||||
from sqlalchemy import inspect
|
||||
from sqlalchemy.ext.asyncio import AsyncEngine
|
||||
|
||||
pytestmark = [pytest.mark.integration, pytest.mark.postgres, pytest.mark.asyncio]
|
||||
pytestmark = [
|
||||
pytest.mark.integration,
|
||||
pytest.mark.postgres,
|
||||
pytest.mark.asyncio(loop_scope="session"),
|
||||
]
|
||||
|
||||
EXPECTED_TABLES = {
|
||||
"tenants",
|
||||
|
||||
Reference in New Issue
Block a user