Skip to content

Commit cd3ce24

Browse files
committed
removed aiopg
1 parent e269658 commit cd3ce24

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

services/director-v2/tests/integration/02/test_dynamic_sidecar_nodeports_integration.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import pytest
2121
import sqlalchemy as sa
2222
from aiodocker.containers import DockerContainer
23-
from aiopg.sa import Engine
2423
from faker import Faker
2524
from fastapi import FastAPI
2625
from helpers.shared_comp_utils import (
@@ -450,9 +449,9 @@ async def projects_networks_db(
450449
project_uuid=current_study.uuid, networks_with_aliases=networks_with_aliases
451450
)
452451

453-
engine: Engine = initialized_app.state.engine
452+
engine: AsyncEngine = initialized_app.state.engine
454453

455-
async with engine.acquire() as conn:
454+
async with engine.begin() as conn:
456455
row_data = projects_networks_to_insert.model_dump()
457456
insert_stmt = pg_insert(projects_networks).values(**row_data)
458457
upsert_snapshot = insert_stmt.on_conflict_do_update(

services/director-v2/tests/unit/with_dbs/comp_scheduler/test_api_route_computations.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from typing import Any
1818
from unittest import mock
1919

20-
import aiopg.sa
2120
import httpx
2221
import pytest
2322
import respx
@@ -63,6 +62,7 @@
6362
_RAM_SAFE_MARGIN_RATIO,
6463
)
6564
from simcore_service_director_v2.utils.computations import to_node_class
65+
from sqlalchemy.ext.asyncio import AsyncEngine
6666

6767
pytest_simcore_core_services_selection = ["postgres", "rabbit", "redis"]
6868
pytest_simcore_ops_services_selection = [
@@ -169,7 +169,6 @@ def _mocked_service_resources(request) -> httpx.Response:
169169
def _mocked_services_details(
170170
request, service_key: str, service_version: str
171171
) -> httpx.Response:
172-
173172
data_published = fake_service_details.model_copy(
174173
update={
175174
"key": urllib.parse.unquote(service_key),
@@ -500,7 +499,7 @@ async def test_create_computation_with_wallet(
500499
wallet_info: WalletInfo,
501500
project_nodes_overrides: dict[str, Any],
502501
default_pricing_plan_aws_ec2_type: str | None,
503-
aiopg_engine: aiopg.sa.Engine,
502+
sqlalchemy_async_engine: AsyncEngine,
504503
fake_ec2_cpus: PositiveInt,
505504
fake_ec2_ram: ByteSize,
506505
):
@@ -541,7 +540,7 @@ async def test_create_computation_with_wallet(
541540
* 2
542541
)
543542
# check the project nodes were really overriden now
544-
async with aiopg_engine.acquire() as connection:
543+
async with sqlalchemy_async_engine.connect() as connection:
545544
project_nodes_repo = ProjectNodesRepo(project_uuid=proj.uuid)
546545
for node in await project_nodes_repo.list(connection):
547546
if (

0 commit comments

Comments
 (0)