@@ -27,7 +27,7 @@ def mock_state():
2727 workflows = {}
2828
2929 @asynccontextmanager
30- async def mock_claim (wid ):
30+ async def mock_claim (_wid ):
3131 yield
3232
3333 async def get_workflow (wid ):
@@ -57,7 +57,7 @@ class Start(LoopEvent):
5757 pass
5858
5959 @app .workflow (name = "test" , start_event = Start )
60- async def test_workflow (ctx , blocks , block ):
60+ async def test_workflow (ctx , _blocks , _block ):
6161 ctx .next ()
6262
6363 return app
@@ -121,7 +121,7 @@ async def test_next_advances_blocks(self, mock_state):
121121 )
122122 mock_state ._workflows ["test" ] = workflow
123123
124- async def func (ctx , blocks , block ):
124+ async def func (ctx , _blocks , block ):
125125 executed .append (block .type )
126126 ctx .next ()
127127
@@ -145,7 +145,7 @@ async def test_repeat_stays_on_block(self, mock_state):
145145 )
146146 mock_state ._workflows ["test" ] = workflow
147147
148- async def func (ctx , blocks , block ):
148+ async def func (ctx , _blocks , _block ):
149149 count [0 ] += 1
150150 if count [0 ] < 3 :
151151 ctx .repeat ()
@@ -171,7 +171,7 @@ async def test_normal_return_stops(self, mock_state):
171171 )
172172 mock_state ._workflows ["test" ] = workflow
173173
174- async def func (ctx , blocks , block ):
174+ async def func (_ctx , _blocks , block ):
175175 executed .append (block .type )
176176
177177 wm = WorkflowManager (mock_state )
@@ -191,7 +191,7 @@ async def test_next_passes_payload(self, mock_state):
191191 )
192192 mock_state ._workflows ["test" ] = workflow
193193
194- async def func (ctx , blocks , block ):
194+ async def func (ctx , _blocks , _block ):
195195 ctx .next ({"key" : "value" })
196196
197197 ctx = MagicMock ()
@@ -219,10 +219,10 @@ async def test_on_block_complete_called(self, mock_state):
219219 )
220220 mock_state ._workflows ["test" ] = workflow
221221
222- def on_complete (ctx , block , payload ):
222+ def on_complete (_ctx , block , _payload ):
223223 completed .append (block .type )
224224
225- async def func (ctx , blocks , block ):
225+ async def func (ctx , _blocks , _block ):
226226 ctx .next ()
227227
228228 ctx = MagicMock ()
@@ -245,10 +245,10 @@ async def test_on_block_complete_on_normal_return(self, mock_state):
245245 )
246246 mock_state ._workflows ["test" ] = workflow
247247
248- def on_complete (ctx , block , payload ):
248+ def on_complete (_ctx , block , _payload ):
249249 completed .append (block .type )
250250
251- async def func (ctx , blocks , block ):
251+ async def func (_ctx , _blocks , _block ):
252252 pass
253253
254254 wm = WorkflowManager (mock_state )
@@ -267,10 +267,10 @@ async def test_on_error_called(self, mock_state):
267267 )
268268 mock_state ._workflows ["test" ] = workflow
269269
270- def on_error (ctx , block , error ):
270+ def on_error (_ctx , block , error ):
271271 errors .append ((block .type , str (error )))
272272
273- async def func (ctx , blocks , block ):
273+ async def func (_ctx , _blocks , _block ):
274274 raise ValueError ("boom" )
275275
276276 wm = WorkflowManager (mock_state )
@@ -298,11 +298,11 @@ async def test_on_error_can_retry(self, mock_state):
298298 )
299299 mock_state ._workflows ["test" ] = workflow
300300
301- def on_error (ctx , block , error ):
301+ def on_error (ctx , _block , _error ):
302302 if attempts [0 ] < 3 :
303303 ctx .repeat ()
304304
305- async def func (ctx , blocks , block ):
305+ async def func (_ctx , _blocks , _block ):
306306 attempts [0 ] += 1
307307 if attempts [0 ] < 3 :
308308 raise ValueError ("transient error" )
@@ -339,7 +339,7 @@ async def test_block_position(self, mock_state):
339339 )
340340 mock_state ._workflows ["test" ] = workflow
341341
342- async def func (ctx , blocks , block ):
342+ async def func (ctx , _blocks , _block ):
343343 captured .append (
344344 {
345345 "index" : ctx .block_index ,
@@ -379,7 +379,7 @@ async def test_resumes_from_block_index(self, mock_state):
379379 )
380380 mock_state ._workflows ["test" ] = workflow
381381
382- async def func (ctx , blocks , block ):
382+ async def func (_ctx , _blocks , block ):
383383 executed .append (block .type )
384384
385385 wm = WorkflowManager (mock_state )
@@ -392,10 +392,10 @@ async def test_ctx_state_persists(self, mock_state):
392392 """ctx.set/get persists state."""
393393 stored = {}
394394
395- async def set_val (wid , key , val ):
395+ async def set_val (_wid , key , val ):
396396 stored [key ] = val
397397
398- async def get_val (wid , key ):
398+ async def get_val (_wid , key ):
399399 return stored .get (key )
400400
401401 mock_state .set_context_value = set_val
@@ -533,7 +533,7 @@ async def test_workflow_resumes_from_persisted_state(self, state_manager):
533533 workflow .status = LoopStatus .RUNNING
534534 await state_manager .update_workflow (workflow .workflow_id , workflow )
535535
536- async def func (ctx , blocks , block ):
536+ async def func (ctx , _blocks , block ):
537537 executed .append (block .type )
538538 ctx .next ()
539539
@@ -587,7 +587,7 @@ def mock_state_with_persistence(self):
587587 workflows = {}
588588
589589 @asynccontextmanager
590- async def mock_claim (wid ):
590+ async def mock_claim (_wid ):
591591 yield
592592
593593 async def get_workflow (wid ):
@@ -614,7 +614,7 @@ async def test_retry_with_backoff(self, mock_state_with_persistence):
614614
615615 attempts = []
616616
617- async def failing_func (ctx , blocks , block ):
617+ async def failing_func (ctx , _blocks , _block ):
618618 attempts .append (time .time ())
619619 if len (attempts ) < 3 :
620620 raise ValueError ("Transient error" )
@@ -650,7 +650,7 @@ async def failing_func(ctx, blocks, block):
650650 async def test_workflow_fails_after_max_retries (self , mock_state_with_persistence ):
651651 """Workflow status set to FAILED after max retries."""
652652
653- async def always_fails (ctx , blocks , block ):
653+ async def always_fails (_ctx , _blocks , _block ):
654654 raise ValueError ("Always fails" )
655655
656656 workflow = WorkflowState (
0 commit comments