refactor: fixture_loader and conftest refactored
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user