Skip to content

Commit 1df91f6

Browse files
committed
use asyncpg
1 parent 9bdb64d commit 1df91f6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

services/web/server/tests/integration/01/notifications/test_rabbitmq_consumers.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
from typing import Any
99
from unittest import mock
1010

11-
import aiopg
12-
import aiopg.sa
1311
import pytest
1412
import socketio
1513
import sqlalchemy as sa
1614
from aiohttp.test_utils import TestClient
15+
from aioresponses import aioresponses as AioResponsesMock
1716
from faker import Faker
1817
from models_library.api_schemas_webserver.socketio import SocketIORoomStr
1918
from models_library.progress_bar import ProgressReport
@@ -63,6 +62,7 @@
6362
)
6463
from simcore_service_webserver.socketio.models import WebSocketNodeProgress
6564
from simcore_service_webserver.socketio.plugin import setup_socketio
65+
from sqlalchemy.ext.asyncio import AsyncEngine
6666
from tenacity import RetryError
6767
from tenacity.asyncio import AsyncRetrying
6868
from tenacity.retry import retry_always, retry_if_exception_type
@@ -76,6 +76,7 @@
7676
]
7777

7878
pytest_simcore_ops_services_selection = [
79+
"adminer",
7980
"redis-commander",
8081
]
8182

@@ -410,14 +411,15 @@ async def mocked_dynamic_services_interface(
410411
)
411412
async def test_progress_computational_workflow(
412413
mocked_dynamic_services_interface,
414+
director_v2_service_mock: AioResponsesMock,
413415
client: TestClient,
414416
rabbitmq_publisher: RabbitMQClient,
415417
user_project: ProjectDict,
416418
create_socketio_connection: Callable[
417419
[str | None, TestClient | None], Awaitable[tuple[socketio.AsyncClient, str]]
418420
],
419421
mocker: MockerFixture,
420-
aiopg_engine: aiopg.sa.Engine,
422+
sqlalchemy_async_engine: AsyncEngine,
421423
subscribe_to_logs: bool,
422424
# user
423425
sender_same_user_id: bool,
@@ -468,15 +470,14 @@ async def test_progress_computational_workflow(
468470
await _assert_handler_not_called(mock_progress_handler)
469471

470472
# check the database. doing it after the waiting calls above is safe
471-
async with aiopg_engine.acquire() as conn:
473+
async with sqlalchemy_async_engine.connect() as conn:
472474
assert projects is not None
473475
result = await conn.execute(
474476
sa.select(projects.c.workbench).where(
475477
projects.c.uuid == str(user_project_id)
476478
)
477479
)
478-
row = await result.fetchone()
479-
assert row
480+
row = result.one()
480481
project_workbench = dict(row[projects.c.workbench])
481482
# NOTE: the progress might still be present but is not used anymore
482483
assert (

0 commit comments

Comments
 (0)