test(simple_metrics): build the input outside pytest.raises (Sonar python:S5778) (SIENTIAPDE-2191)

This commit is contained in:
PedroHMCosme
2026-10-09 10:36:32 -03:00
parent e1b94b1da4
commit 6cc69b0f93

View File

@@ -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')] side_effect=[[_ROW] * 3, None, RuntimeError('dispatch failed')]
) )
workflow_mock.execute_local_activity_method = AsyncMock(return_value=_BREACH_ROWS) workflow_mock.execute_local_activity_method = AsyncMock(return_value=_BREACH_ROWS)
input_data = _input(simple_metrics_thresholds=_THRESHOLDS)
with raises(RuntimeError, match='dispatch failed'): 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 # Metrics were exported before the failing call
calls = workflow_mock.execute_activity_method.call_args_list calls = workflow_mock.execute_activity_method.call_args_list