Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -32,7 +32,7 @@ class TestCreditTransactionRepository:
|
||||
async def credit_transaction_repository(
|
||||
self,
|
||||
test_session: AsyncSession,
|
||||
) -> AsyncGenerator[CreditTransactionRepository, None]:
|
||||
) -> AsyncGenerator[CreditTransactionRepository]:
|
||||
"""Create a credit transaction repository instance."""
|
||||
yield CreditTransactionRepository(test_session)
|
||||
|
||||
@@ -50,7 +50,7 @@ class TestCreditTransactionRepository:
|
||||
self,
|
||||
test_session: AsyncSession,
|
||||
test_user_id: int,
|
||||
) -> AsyncGenerator[list[CreditTransaction], None]:
|
||||
) -> AsyncGenerator[list[CreditTransaction]]:
|
||||
"""Create test credit transactions."""
|
||||
transactions = []
|
||||
user_id = test_user_id
|
||||
@@ -115,7 +115,7 @@ class TestCreditTransactionRepository:
|
||||
self,
|
||||
test_session: AsyncSession,
|
||||
ensure_plans: tuple[Any, ...],
|
||||
) -> AsyncGenerator[CreditTransaction, None]:
|
||||
) -> AsyncGenerator[CreditTransaction]:
|
||||
"""Create a transaction for a different user."""
|
||||
# Create another user
|
||||
user_repo = UserRepository(test_session)
|
||||
|
||||
Reference in New Issue
Block a user