Conversation
…ages, and add regression tests
kdaily
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background:
@skip_if_windows,@skip_if_using_serial_implementation, and@requires_crtare decorator factories intests/utils/s3transfer/__init__.pyfor cli v2.@skip_if_windowsand@skip_if_using_serial_implementationare decorator factories that require parentheses. If they are used without parentheses (e.g., bare@skip_if_using_serial_implementation), this is unsafe because Python passes the test function as the first argument, causing the real test body to never run. Assertions are never evaluated, but the test may still appear to pass or skip silently. However, these two did not raise an error on bare usage.On the other hand,
@requires_crtin cli v2 only worked correctly with bare usage, while cli v1, botocore, boto3, and s3transfer already required the parenthesized form@requires_crt(). This cross-repo inconsistency creates a maintainer footgun because contributors move between repos and assume the decorator behaves the same way everywhere. It needs to be standardized to only accept the parenthesized form and all existing bare usages need to be updated.Note:
requires_crt_pytestintests/unit/s3transfer/test_crt.pyis apytest.mark.skipifobject, not a decorator factory. Bare usage is the correct form for it and is not affected by this change. Similarly, there is anotherskip_if_windowsdefined intests/markers.pywhich is also apytest.mark.skipifobject and is not affected.Description of changes:
All three decorator factories in
tests/utils/s3transfer/__init__.pynow raise aTypeErroron bare usage.@requires_crtis updated to only accept the parenthesized form for consistency with the other two decorators in this repo as well as cli v1 and other repos. All existing bare@requires_crtusages across test files are updated to@requires_crt().Testing:
Regression tests are added in
tests/unit/test_decorators.pyto verify correct behavior for all three decorators. All tests including the new tests pass.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.