Skip to content

Commit a256a09

Browse files
committed
simcore-sdk migrated
1 parent 22596c0 commit a256a09

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

services/director-v2/tests/unit/with_dbs/test_utils_dask.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
parse_dask_job_id,
6464
parse_output_data,
6565
)
66+
from sqlalchemy.ext.asyncio import AsyncEngine
6667
from yarl import URL
6768

6869
pytest_simcore_core_services_selection = [
@@ -299,6 +300,7 @@ def _app_config_with_db(
299300
async def test_compute_input_data(
300301
_app_config_with_db: None,
301302
aiopg_engine: aiopg.sa.engine.Engine,
303+
sqlalchemy_async_engine: AsyncEngine,
302304
initialized_app: FastAPI,
303305
user_id: UserID,
304306
published_project: PublishedProject,
@@ -347,7 +349,7 @@ def return_fake_input_value(*args, **kwargs):
347349
side_effect=return_fake_input_value(),
348350
)
349351
node_ports = await create_node_ports(
350-
db_engine=initialized_app.state.engine,
352+
db_engine=sqlalchemy_async_engine,
351353
user_id=user_id,
352354
project_id=published_project.project.uuid,
353355
node_id=sleeper_task.node_id,
@@ -377,6 +379,7 @@ def tasks_file_link_scheme(tasks_file_link_type: FileLinkType) -> tuple:
377379
async def test_compute_output_data_schema(
378380
_app_config_with_db: None,
379381
aiopg_engine: aiopg.sa.engine.Engine,
382+
sqlalchemy_async_engine: AsyncEngine,
380383
initialized_app: FastAPI,
381384
user_id: UserID,
382385
published_project: PublishedProject,
@@ -393,7 +396,7 @@ async def test_compute_output_data_schema(
393396
)
394397

395398
node_ports = await create_node_ports(
396-
db_engine=initialized_app.state.engine,
399+
db_engine=sqlalchemy_async_engine,
397400
user_id=user_id,
398401
project_id=published_project.project.uuid,
399402
node_id=sleeper_task.node_id,
@@ -438,9 +441,9 @@ async def test_clean_task_output_and_log_files_if_invalid(
438441
# BEFORE the task is actually run. In case there is a failure at running
439442
# the task, these entries shall be cleaned up. The way to check this is
440443
# by asking storage if these file really exist. If not they get deleted.
441-
mocked_node_ports_filemanager_fcts[
442-
"entry_exists"
443-
].return_value = entry_exists_returns
444+
mocked_node_ports_filemanager_fcts["entry_exists"].return_value = (
445+
entry_exists_returns
446+
)
444447

445448
sleeper_task = published_project.tasks[1]
446449

@@ -500,7 +503,7 @@ def _add_is_directory(entry: mock._Call) -> mock._Call: # noqa: SLF001
500503
"req_example", NodeRequirements.model_config["json_schema_extra"]["examples"]
501504
)
502505
def test_node_requirements_correctly_convert_to_dask_resources(
503-
req_example: dict[str, Any]
506+
req_example: dict[str, Any],
504507
):
505508
node_reqs = NodeRequirements(**req_example)
506509
assert node_reqs

0 commit comments

Comments
 (0)