Skip to content

Commit cf26135

Browse files
author
Вадим Козыревский
committed
fix after review
1 parent d233e04 commit cf26135

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

tests/integration/conftest.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@
2323
OrderSaga,
2424
PaymentProcessedEvent,
2525
PaymentProcessedEventHandler,
26-
ProcessPaymentResponse,
2726
ProcessPaymentStep,
28-
ReserveInventoryResponse,
2927
ReserveInventoryStep,
30-
ShipOrderResponse,
3128
ShipOrderStep,
3229
)
3330

tests/integration/test_saga_mediator_sqlalchemy_postgres.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
"""Integration tests for SagaMediator with SqlAlchemySagaStorage (PostgreSQL)."""
22

33
import uuid
4+
from unittest import mock
45

56
import pytest
67
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
78

89
import cqrs
10+
from cqrs import events, SagaMap
911
from cqrs.saga.storage.enums import SagaStatus
1012
from cqrs.saga.storage.sqlalchemy import SqlAlchemySagaStorage
13+
from integration.conftest import _TestContainer
1114

1215
from tests.integration.test_saga_mediator_memory import (
1316
FailingOrderSaga,
1417
InventoryReservedEventHandler,
1518
OrderContext,
16-
OrderShippedEventHandler,
19+
OrderSaga, OrderShippedEventHandler,
1720
PaymentProcessedEventHandler,
1821
ProcessPaymentResponse,
1922
ProcessPaymentStep,

tests/integration/test_saga_storage_sqlalchemy_postgres.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Uses DATABASE_DSN_POSTGRESQL from fixtures (pytest-config.ini / env).
33
"""
44

5-
import asyncio
65
import uuid
76
from collections.abc import AsyncGenerator
87
from datetime import datetime, timedelta, timezone
@@ -253,9 +252,7 @@ async def test_get_sagas_for_recovery_ordered_by_updated_at(
253252
later = datetime.now(timezone.utc) + timedelta(seconds=10)
254253
async with storage.session_factory() as session:
255254
await session.execute(
256-
update(SagaExecutionModel)
257-
.where(SagaExecutionModel.id == id2)
258-
.values(updated_at=later),
255+
update(SagaExecutionModel).where(SagaExecutionModel.id == id2).values(updated_at=later),
259256
)
260257
await session.commit()
261258
ids = await storage.get_sagas_for_recovery(limit=10)

0 commit comments

Comments
 (0)