adiranjan25 commented on code in PR #76855:
URL: https://github.com/apache/airflow/pull/76855#discussion_r4529418591


##########
providers/amazon/tests/unit/amazon/aws/hooks/test_s3.py:
##########
@@ -678,6 +678,19 @@ async def 
test_s3_key_hook_get_file_metadata_async_when_requester_pays_is(self,
             **extra_params,
         )
 
+    @pytest.mark.asyncio
+    async def test_get_head_object_async_does_not_print_to_stdout(self, 
capsys):
+        """Async S3 calls must not emit debug output to stdout."""
+        hook = S3Hook(aws_conn_id=None)
+        client = AsyncMock()
+        client.head_object.return_value = {"ContentLength": 10}
+
+        result = await hook.get_head_object_async(client, "test-key", 
"test-bucket")
+
+        assert result == {"ContentLength": 10}

Review Comment:
   Thank you, @dabla, for the detailed review and helpful suggestions.
   
   I've addressed both comments in commit `fc9a6c56`:
   
   - Added a specification to the mocked S3 client, with an explicitly 
asynchronous `head_object` method.
   - Added `assert_awaited_once_with()` to verify the exact bucket and key 
arguments.
   
   The official Airflow regression test now passes locally (1 passed), and Ruff 
lint, formatting, and whitespace checks are all successful.
   
   I've also updated the PR testing information. The upstream CI workflows are 
awaiting maintainer approval.
   
   Thanks again for your feedback!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to