From 005ecb3b763fcf37619741bd60f45cd11d663eed Mon Sep 17 00:00:00 2001 From: Niels Kootstra <545768+nkootstra@users.noreply.github.com> Date: Tue, 29 Sep 2026 23:14:14 +0200 Subject: [PATCH] test(s3): assert NoSuchTagSet after DeleteBucketTagging in the Python compat suite (#4687) The test accepted any ClientError, so an access-denied or server error after DeleteBucketTagging also passed. GetBucketTagging now returns NoSuchTagSet for a bucket without tags, as AWS does, so assert that error code. --- compatibility-tests/sdk-test-python/tests/test_s3.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/compatibility-tests/sdk-test-python/tests/test_s3.py b/compatibility-tests/sdk-test-python/tests/test_s3.py index 1b2d4360c3..562ff3527a 100644 --- a/compatibility-tests/sdk-test-python/tests/test_s3.py +++ b/compatibility-tests/sdk-test-python/tests/test_s3.py @@ -313,12 +313,9 @@ class TestS3BucketTagging: s3_client.delete_bucket_tagging(Bucket=test_bucket) - # Either empty tags or NoSuchTagSet error - try: - response = s3_client.get_bucket_tagging(Bucket=test_bucket) - assert len(response.get("TagSet", [])) == 0 - except ClientError: - pass # NoSuchTagSet is also acceptable + with pytest.raises(ClientError) as exc_info: + s3_client.get_bucket_tagging(Bucket=test_bucket) + assert exc_info.value.response["Error"]["Code"] == "NoSuchTagSet" class TestS3LargeObject: