ref: Remove unused sync session_scope, with_session and engine (#5333)

Remove unused sync session_scope, with_session and engine
This commit is contained in:
Christophe Bornet 2024-12-18 21:52:06 +01:00 • committed by GitHub
commit 3f0e383135
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 75 additions and 114 deletions

View file

@ -400,7 +400,7 @@ async def test_user(client):
@pytest.fixture
async def active_user(client): # noqa: ARG001
db_manager = get_db_service()
async with db_manager.with_async_session() as session:
async with db_manager.with_session() as session:
user = User(
username="activeuser",
password=get_password_hash("testpassword"),
@ -418,7 +418,7 @@ async def active_user(client): # noqa: ARG001
yield user
# Clean up
# Now cleanup transactions, vertex_build
async with db_manager.with_async_session() as session:
async with db_manager.with_session() as session:
user = await session.get(User, user.id, options=[selectinload(User.flows)])
await _delete_transactions_and_vertex_builds(session, user.flows)
await session.delete(user)
@ -439,7 +439,7 @@ async def logged_in_headers(client, active_user):
@pytest.fixture
async def active_super_user(client): # noqa: ARG001
db_manager = get_db_service()
async with db_manager.with_async_session() as session:
async with db_manager.with_session() as session:
user = User(
username="activeuser",
password=get_password_hash("testpassword"),
@ -457,7 +457,7 @@ async def active_super_user(client): # noqa: ARG001
yield user
# Clean up
# Now cleanup transactions, vertex_build
async with db_manager.with_async_session() as session:
async with db_manager.with_session() as session:
user = await session.get(User, user.id, options=[selectinload(User.flows)])
await _delete_transactions_and_vertex_builds(session, user.flows)
await session.delete(user)