@@ -113,15 +113,12 @@ async def lifespan(app):
113113
114114 async with anyio .create_task_group () as tg :
115115 task_group = tg
116- print ("Application started, task group initialized!" )
117116 try :
118117 yield
119118 finally :
120- print ("Application shutting down, cleaning up resources..." )
121119 if task_group :
122120 tg .cancel_scope .cancel ()
123121 task_group = None
124- print ("Resources cleaned up successfully." )
125122
126123 async def handle_streamable_http (scope , receive , send ):
127124 request = Request (scope , receive )
@@ -148,14 +145,11 @@ async def handle_streamable_http(scope, receive, send):
148145 read_stream , write_stream = streams
149146
150147 async def run_server ():
151- try :
152- await server .run (
153- read_stream ,
154- write_stream ,
155- server .create_initialization_options (),
156- )
157- except Exception as e :
158- print (f"Server exception: { e } " )
148+ await server .run (
149+ read_stream ,
150+ write_stream ,
151+ server .create_initialization_options (),
152+ )
159153
160154 if task_group is None :
161155 response = Response (
@@ -196,10 +190,6 @@ def run_server(port: int, is_json_response_enabled=False) -> None:
196190 port: Port to listen on.
197191 is_json_response_enabled: If True, use JSON responses instead of SSE streams.
198192 """
199- print (
200- f"Starting test server on port { port } with "
201- f"json_enabled={ is_json_response_enabled } "
202- )
203193
204194 app = create_app (is_json_response_enabled )
205195 # Configure server
@@ -218,16 +208,12 @@ def run_server(port: int, is_json_response_enabled=False) -> None:
218208
219209 # This is important to catch exceptions and prevent test hangs
220210 try :
221- print ("Server starting..." )
222211 server .run ()
223- except Exception as e :
224- print (f"ERROR: Server failed to run: { e } " )
212+ except Exception :
225213 import traceback
226214
227215 traceback .print_exc ()
228216
229- print ("Server shutdown" )
230-
231217
232218# Test fixtures - using same approach as SSE tests
233219@pytest .fixture
@@ -273,8 +259,6 @@ def basic_server(basic_server_port: int) -> Generator[None, None, None]:
273259 # Clean up
274260 proc .kill ()
275261 proc .join (timeout = 2 )
276- if proc .is_alive ():
277- print ("server process failed to terminate" )
278262
279263
280264@pytest .fixture
@@ -306,8 +290,6 @@ def json_response_server(json_server_port: int) -> Generator[None, None, None]:
306290 # Clean up
307291 proc .kill ()
308292 proc .join (timeout = 2 )
309- if proc .is_alive ():
310- print ("server process failed to terminate" )
311293
312294
313295@pytest .fixture
0 commit comments