test(simple_metrics): build the input outside pytest.raises (Sonar python:S5778) (SIENTIAPDE-2191)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user