From 6cc69b0f9311da3f6fe08ad5b199f7d8d51bd570 Mon Sep 17 00:00:00 2001 From: PedroHMCosme Date: Fri, 9 Oct 2026 10:36:32 -0300 Subject: [PATCH] test(simple_metrics): build the input outside pytest.raises (Sonar python:S5778) (SIENTIAPDE-2191) --- tests/laborious/workflows/test_simple_metrics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/laborious/workflows/test_simple_metrics.py b/tests/laborious/workflows/test_simple_metrics.py index 065ccec..a3c8632 100644 --- a/tests/laborious/workflows/test_simple_metrics.py +++ b/tests/laborious/workflows/test_simple_metrics.py @@ -408,9 +408,10 @@ async def test_run_adaptive_state_failure_fails_workflow(workflow_mock, simple_m side_effect=[[_ROW] * 3, None, RuntimeError('dispatch failed')] ) workflow_mock.execute_local_activity_method = AsyncMock(return_value=_BREACH_ROWS) + input_data = _input(simple_metrics_thresholds=_THRESHOLDS) with raises(RuntimeError, match='dispatch failed'): - await simple_metrics.run(_input(simple_metrics_thresholds=_THRESHOLDS)) + await simple_metrics.run(input_data) # Metrics were exported before the failing call calls = workflow_mock.execute_activity_method.call_args_list