Skip to content

Commit 61984ba

Browse files
committed
cleanup
1 parent 935c65f commit 61984ba

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/application.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ def create_base_app() -> FastAPI:
137137
logger.debug(settings.model_dump_json(indent=2))
138138

139139
# minimal
140+
assert settings.SC_BOOT_MODE # nosec
140141
app = FastAPI(
141-
debug=settings.SC_BOOT_MODE.is_devel_mode(), # pylint: disable=no-member
142+
debug=settings.SC_BOOT_MODE.is_devel_mode(),
142143
title=PROJECT_NAME,
143144
description=SUMMARY,
144145
version=API_VERSION,
@@ -199,7 +200,8 @@ def create_app():
199200

200201
# ERROR HANDLERS ------------
201202
app.add_exception_handler(
202-
NodeNotFound, node_not_found_error_handler # type: ignore[arg-type]
203+
NodeNotFound,
204+
node_not_found_error_handler, # type: ignore[arg-type]
203205
)
204206
app.add_exception_handler(BaseDynamicSidecarError, http_error_handler) # type: ignore[arg-type]
205207

services/dynamic-sidecar/tests/conftest.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import json
99
import logging
1010
import sys
11-
from collections.abc import AsyncIterable, Iterable, Iterator
11+
from collections.abc import Iterable, Iterator
1212
from pathlib import Path
1313
from unittest.mock import AsyncMock
1414

@@ -151,13 +151,6 @@ def mock_storage_check(mocker: MockerFixture) -> None:
151151
)
152152

153153

154-
@pytest.fixture
155-
def mock_postgres_check(mocker: MockerFixture) -> None:
156-
mocker.patch(
157-
"simcore_service_dynamic_sidecar.core.external_dependencies.connect_to_db",
158-
)
159-
160-
161154
@pytest.fixture
162155
def mock_rabbit_check(mocker: MockerFixture) -> None:
163156
mocker.patch(
@@ -210,7 +203,6 @@ def base_mock_envs(
210203
def mock_environment(
211204
postgres_host_config: PostgresTestConfig,
212205
mock_storage_check: None,
213-
# mock_postgres_check: None,
214206
mock_rabbit_check: None,
215207
monkeypatch: pytest.MonkeyPatch,
216208
base_mock_envs: EnvVarsDict,
@@ -357,7 +349,7 @@ def mock_metrics_params(faker: Faker) -> CreateServiceMetricsAdditionalParams:
357349

358350

359351
@pytest.fixture
360-
def cleanup_reserved_disk_space() -> AsyncIterable[None]:
352+
def cleanup_reserved_disk_space() -> Iterator[None]:
361353
remove_reserved_disk_space()
362354
yield
363355
remove_reserved_disk_space()

services/dynamic-sidecar/tests/unit/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from unittest.mock import AsyncMock
99

1010
import pytest
11+
import sqlalchemy as sa
1112
from aiodocker.volumes import DockerVolume
1213
from async_asgi_testclient import TestClient
1314
from fastapi import FastAPI
@@ -41,6 +42,7 @@
4142

4243
@pytest.fixture
4344
def app(
45+
postgres_db: sa.engine.Engine,
4446
mock_environment: EnvVarsDict,
4547
mock_registry_service: AsyncMock,
4648
mock_core_rabbitmq: dict[str, AsyncMock],
@@ -72,7 +74,7 @@ async def test_client(
7274
@pytest.fixture
7375
async def ensure_external_volumes(
7476
app: FastAPI,
75-
) -> AsyncIterator[tuple[DockerVolume]]:
77+
) -> AsyncIterator[tuple[DockerVolume, ...]]:
7678
"""ensures inputs and outputs volumes for the service are present
7779
7880
Emulates creation of volumes by the directorv2 when it spawns the dynamic-sidecar service

0 commit comments

Comments
 (0)