@@ -187,10 +187,8 @@ def test_closing_connection_closes_commands(self, mock_thrift_client_class):
187187 mock_execute_response .has_been_closed_server_side = closed
188188 mock_execute_response .is_staging_operation = False
189189
190- # Mock the backend that will be used by the real ThriftResultSet
190+ # Mock the backend that will be used
191191 mock_backend = Mock (spec = ThriftBackend )
192-
193- # Configure the decorator's mock to return our specific mock_backend
194192 mock_thrift_client_class .return_value = mock_backend
195193
196194 # Create connection and cursor
@@ -207,19 +205,16 @@ def test_closing_connection_closes_commands(self, mock_thrift_client_class):
207205 cursor .thrift_backend .execute_command = Mock (
208206 return_value = mock_execute_response
209207 )
210-
211- # Execute a command - this should set cursor.active_result_set to our real result set
212208 cursor .execute ("SELECT 1" )
213209
214210 # Verify that cursor.execute() set up the result set correctly
215211 active_result_set = cursor .active_result_set
216212 self .assertEqual (active_result_set .has_been_closed_server_side , closed )
217213
218- # Close the connection - this should trigger the real close chain:
219- # connection.close() -> cursor.close() -> result_set.close()
214+ # Close the connection
220215 connection .close ()
221216
222- # Verify the REAL close logic worked through the chain :
217+ # Verify the close logic worked:
223218 # 1. has_been_closed_server_side should always be True after close()
224219 self .assertTrue (active_result_set .has_been_closed_server_side )
225220
0 commit comments