refactor: fixture_loader and conftest refactored

This commit is contained in:
2025-11-26 16:16:26 +04:00
parent ed00d1483d
commit c8af9ffa4d
2 changed files with 10 additions and 19 deletions

View File

@@ -27,7 +27,7 @@ TEST_DATABASE_URL_FOR_ASYNCPG = f"postgresql://{PG_LOGIN}:{PG_PASSWORD}@127.0.0.
# -------------------------------------------------------------------
# Create test database + connection pool
# Create test database and session
# -------------------------------------------------------------------
@pytest.fixture(scope="function")
@@ -40,10 +40,9 @@ def event_loop():
@pytest.fixture(scope="function")
async def db_session() -> AsyncGenerator[AsyncSession, None]:
# Create test engine
test_engine = create_async_engine(
TEST_DATABASE_URL,
poolclass=StaticPool, # Useful for tests
poolclass=StaticPool,
)
# Test session factory
@@ -91,7 +90,7 @@ async def client(db_session: AsyncSession):
# -------------------------------------------------------------------
# Auth token fixture
# Authorized client fixture
# -------------------------------------------------------------------
@pytest.fixture(scope="function")