@@ -73,9 +73,7 @@ async def send(message):
7373 with pytest .raises (RuntimeError ) as excinfo :
7474 await manager .handle_request (scope , receive , send )
7575
76- assert "Task group is not initialized. Make sure to use run()." in str (
77- excinfo .value
78- )
76+ assert "Task group is not initialized. Make sure to use run()." in str (excinfo .value )
7977
8078
8179class TestException (Exception ):
@@ -137,12 +135,10 @@ async def mock_receive():
137135 # Give other tasks a chance to run. This is important for the finally block.
138136 await anyio .sleep (0.01 )
139137
140- assert (
141- session_id not in manager ._server_instances
142- ), "Session ID should be removed from _server_instances after graceful exit"
143- assert (
144- not manager ._server_instances
145- ), "No sessions should be tracked after the only session exits gracefully"
138+ assert session_id not in manager ._server_instances , (
139+ "Session ID should be removed from _server_instances after graceful exit"
140+ )
141+ assert not manager ._server_instances , "No sessions should be tracked after the only session exits gracefully"
146142
147143
148144@pytest .mark .anyio
@@ -195,10 +191,7 @@ async def mock_receive():
195191 # Give other tasks a chance to run to ensure the finally block executes
196192 await anyio .sleep (0.01 )
197193
198- assert (
199- session_id not in manager ._server_instances
200- ), "Session ID should be removed from _server_instances after an exception"
201- assert (
202- not manager ._server_instances
203- ), "No sessions should be tracked after the only session crashes"
204-
194+ assert session_id not in manager ._server_instances , (
195+ "Session ID should be removed from _server_instances after an exception"
196+ )
197+ assert not manager ._server_instances , "No sessions should be tracked after the only session crashes"
0 commit comments