@@ -290,7 +290,9 @@ def init_api_delayed():
290290 init_thread .start ()
291291
292292 # Verify API is not initialized yet (state assertion)
293- assert mcp_mod .api is None , "API should not be initialized at test start"
293+ assert (
294+ mcp_mod .api is None
295+ ), "API should not be initialized at test start"
294296
295297 # Call tool - should wait for API to initialize
296298 result = await call_tool (
@@ -304,13 +306,18 @@ def init_api_delayed():
304306 # State-based assertions: verify the waiting behavior through outcomes
305307 # 1. Tool should have succeeded (not returned initialization error)
306308 assert len (result ) == 1 , "Tool should return exactly one result"
307- assert "not initialized" not in result [0 ].text .lower (), \
308- "Tool should not return 'not initialized' error - call_tool should have waited"
309+ assert (
310+ "not initialized" not in result [0 ].text .lower ()
311+ ), "Tool should not return 'not initialized' error - call_tool should have waited"
309312
310313 # 2. API should now be initialized (after call_tool returns)
311- assert mcp_mod .api is not None , "API should be initialized after call_tool returns"
314+ assert (
315+ mcp_mod .api is not None
316+ ), "API should be initialized after call_tool returns"
312317
313- print ("✓ call_tool correctly waited for API initialization and succeeded" )
318+ print (
319+ "✓ call_tool correctly waited for API initialization and succeeded"
320+ )
314321
315322 # Cleanup
316323 init_thread .join ()
0 commit comments