@@ -47,6 +47,7 @@ def test_handler_registration_and_retrieval(self):
4747
4848 _Requirements: 1.1, 1.4, 2.1_
4949 """
50+
5051 def dummy_handler (event , context ):
5152 return {"status" : "ok" }
5253
@@ -70,6 +71,7 @@ def test_multiple_handler_registration(self):
7071
7172 _Requirements: 1.4_
7273 """
74+
7375 def dummy_handler (event , context ):
7476 return {"status" : "ok" }
7577
@@ -94,20 +96,27 @@ def test_handler_registration_validation(self):
9496
9597 _Requirements: 1.2, 1.3_
9698 """
99+
97100 def dummy_handler (event , context ):
98101 return {"status" : "ok" }
99102
100103 with DurableFunctionTestRunner (handler = dummy_handler ) as runner :
101104 # Empty function name should raise
102- with pytest .raises (InvalidParameterValueException , match = "function_name is required" ):
105+ with pytest .raises (
106+ InvalidParameterValueException , match = "function_name is required"
107+ ):
103108 runner .register_handler ("" , lambda p : p )
104109
105110 # None function name should raise
106- with pytest .raises (InvalidParameterValueException , match = "function_name is required" ):
111+ with pytest .raises (
112+ InvalidParameterValueException , match = "function_name is required"
113+ ):
107114 runner .register_handler (None , lambda p : p )
108115
109116 # None handler should raise
110- with pytest .raises (InvalidParameterValueException , match = "handler is required" ):
117+ with pytest .raises (
118+ InvalidParameterValueException , match = "handler is required"
119+ ):
111120 runner .register_handler ("test-fn" , None )
112121
113122
@@ -188,6 +197,7 @@ def child_handler(payload: str | None) -> str | None:
188197
189198 # Wait for handler to be invoked (scheduler runs async)
190199 import time
200+
191201 time .sleep (0.1 )
192202
193203 # Verify handler was called with correct payload
@@ -236,7 +246,9 @@ def mock_process_checkpoint(**kwargs):
236246 checkpoint_calls .append (kwargs )
237247 # Don't actually process to avoid side effects
238248
239- test_components ["checkpoint_processor" ].process_checkpoint = mock_process_checkpoint
249+ test_components [
250+ "checkpoint_processor"
251+ ].process_checkpoint = mock_process_checkpoint
240252
241253 # Create mock execution
242254 execution_arn = "test-arn"
@@ -260,6 +272,7 @@ def mock_process_checkpoint(**kwargs):
260272
261273 # Wait for handler to complete
262274 import time
275+
263276 time .sleep (0.1 )
264277
265278 # Verify checkpoint was called with SUCCEED action
@@ -289,7 +302,9 @@ def failing_handler(payload: str | None) -> str | None:
289302 def mock_process_checkpoint (** kwargs ):
290303 checkpoint_calls .append (kwargs )
291304
292- test_components ["checkpoint_processor" ].process_checkpoint = mock_process_checkpoint
305+ test_components [
306+ "checkpoint_processor"
307+ ].process_checkpoint = mock_process_checkpoint
293308
294309 # Create mock execution
295310 execution_arn = "test-arn"
@@ -313,6 +328,7 @@ def mock_process_checkpoint(**kwargs):
313328
314329 # Wait for handler to complete
315330 import time
331+
316332 time .sleep (0.1 )
317333
318334 # Verify checkpoint was called with FAIL action
@@ -373,15 +389,18 @@ def test_non_durable_function_result_serialization(self):
373389
374390 _Requirements: 8.2_
375391 """
392+
376393 def child_handler (payload : str | None ) -> str | None :
377394 # Handler returns serialized JSON string
378- return json .dumps ({
379- "string" : "value" ,
380- "number" : 123 ,
381- "boolean" : True ,
382- "array" : [1 , 2 , 3 ],
383- "nested" : {"key" : "value" },
384- })
395+ return json .dumps (
396+ {
397+ "string" : "value" ,
398+ "number" : 123 ,
399+ "boolean" : True ,
400+ "array" : [1 , 2 , 3 ],
401+ "nested" : {"key" : "value" },
402+ }
403+ )
385404
386405 def dummy_handler (event , context ):
387406 return {"status" : "ok" }
@@ -406,6 +425,7 @@ def test_non_durable_function_exception_capture(self):
406425
407426 _Requirements: 8.3_
408427 """
428+
409429 def failing_child (payload : str | None ) -> str | None :
410430 raise RuntimeError ("Child function failed" )
411431
0 commit comments