From 7a549dea145de9bb5cbf918ef2ca39138d73b8bc Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:30:10 +0100 Subject: [PATCH] use pytest match --- .../test_modules_dynamic_sidecar_docker_api.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/director-v2/tests/unit/with_dbs/test_modules_dynamic_sidecar_docker_api.py b/services/director-v2/tests/unit/with_dbs/test_modules_dynamic_sidecar_docker_api.py index 24e708b7005..77c327706fd 100644 --- a/services/director-v2/tests/unit/with_dbs/test_modules_dynamic_sidecar_docker_api.py +++ b/services/director-v2/tests/unit/with_dbs/test_modules_dynamic_sidecar_docker_api.py @@ -427,16 +427,16 @@ async def test_get_swarm_network_missing_network( dynamic_services_scheduler_settings: DynamicServicesSchedulerSettings, docker_swarm: None, ): - with pytest.raises(DynamicSidecarError) as excinfo: + with pytest.raises( + DynamicSidecarError, + match=r"Unexpected dynamic sidecar error: " + r"Swarm network name \(searching for \'\*test_network_name\*\'\) is not configured." + r"Found following networks: \[\]", + ): await docker_api.get_swarm_network( dynamic_services_scheduler_settings.SIMCORE_SERVICES_NETWORK_NAME ) - assert str(excinfo.value) == ( - "Swarm network name (searching for '*test_network_name*') is not configured." - "Found following networks: []" - ) - async def test_recreate_network_multiple_times( network_config: dict[str, Any],