Refactor(backend): improve formatting in services, repositories & tests
- Consistently format multi-line function headers, exception handling, and repository method calls for readability. - Reorganize misplaced imports across modules (e.g., services & tests) into proper sorted order. - Adjust indentation, line breaks, and spacing inconsistencies in tests and migration files. - Cleanup unnecessary trailing newlines and reorganize `__all__` declarations for consistency.
This commit is contained in:
@@ -11,8 +11,8 @@ import pytest
|
||||
from sqlalchemy.exc import OperationalError
|
||||
|
||||
from app.core.repository_exceptions import IntegrityConstraintError
|
||||
from app.repositories.session import session_repo as session_crud
|
||||
from app.models.user_session import UserSession
|
||||
from app.repositories.session import session_repo as session_crud
|
||||
from app.schemas.sessions import SessionCreate
|
||||
|
||||
|
||||
@@ -103,7 +103,9 @@ class TestSessionCRUDCreateSessionFailures:
|
||||
last_used_at=datetime.now(UTC),
|
||||
)
|
||||
|
||||
with pytest.raises(IntegrityConstraintError, match="Failed to create session"):
|
||||
with pytest.raises(
|
||||
IntegrityConstraintError, match="Failed to create session"
|
||||
):
|
||||
await session_crud.create_session(session, obj_in=session_data)
|
||||
|
||||
mock_rollback.assert_called_once()
|
||||
@@ -134,7 +136,9 @@ class TestSessionCRUDCreateSessionFailures:
|
||||
last_used_at=datetime.now(UTC),
|
||||
)
|
||||
|
||||
with pytest.raises(IntegrityConstraintError, match="Failed to create session"):
|
||||
with pytest.raises(
|
||||
IntegrityConstraintError, match="Failed to create session"
|
||||
):
|
||||
await session_crud.create_session(session, obj_in=session_data)
|
||||
|
||||
mock_rollback.assert_called_once()
|
||||
|
||||
Reference in New Issue
Block a user