diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py index aef9c49b4..bb402f493 100644 --- a/moto/awslambda/models.py +++ b/moto/awslambda/models.py @@ -2153,7 +2153,7 @@ class LambdaBackend(BaseBackend): def send_sqs_batch(self, function_arn: str, messages: Any, queue_arn: str) -> bool: success = True for message in messages: - result = self._send_sqs_message(function_arn, message, queue_arn) # type: ignore[arg-type] + result = self._send_sqs_message(function_arn, message, queue_arn) if not result: success = False return success @@ -2335,13 +2335,13 @@ class LambdaBackend(BaseBackend): self, function_name: str, qualifier: str, raw: str ) -> Dict[str, Any]: fn = self.get_function(function_name, qualifier) - return fn.policy.add_statement(raw, qualifier) # type: ignore[union-attr] + return fn.policy.add_statement(raw, qualifier) def remove_permission( self, function_name: str, sid: str, revision: str = "" ) -> None: fn = self.get_function(function_name) - fn.policy.del_statement(sid, revision) # type: ignore[union-attr] + fn.policy.del_statement(sid, revision) def get_code_signing_config(self, function_name: str) -> Dict[str, Any]: fn = self.get_function(function_name) @@ -2351,7 +2351,7 @@ class LambdaBackend(BaseBackend): fn = self._lambdas.get_function_by_name_or_arn_with_qualifier( function_name, qualifier ) - return fn.policy.wire_format() # type: ignore[union-attr] + return fn.policy.wire_format() def update_function_code( self, function_name: str, qualifier: str, body: Dict[str, Any] diff --git a/moto/awslambda_simple/responses.py b/moto/awslambda_simple/responses.py index 04d8c05a5..72f138ce7 100644 --- a/moto/awslambda_simple/responses.py +++ b/moto/awslambda_simple/responses.py @@ -5,4 +5,4 @@ from .models import LambdaBackend, lambda_simple_backends class LambdaSimpleResponse(LambdaResponse): @property def backend(self) -> LambdaBackend: - return lambda_simple_backends[self.current_account][self.region] # type: ignore[return-value] + return lambda_simple_backends[self.current_account][self.region] diff --git a/moto/batch_simple/responses.py b/moto/batch_simple/responses.py index 32c336e32..dfb9e75e9 100644 --- a/moto/batch_simple/responses.py +++ b/moto/batch_simple/responses.py @@ -9,4 +9,4 @@ class BatchSimpleResponse(BatchResponse): :return: Batch Backend :rtype: moto.batch.models.BatchBackend """ - return batch_simple_backends[self.current_account][self.region] # type: ignore[return-value] + return batch_simple_backends[self.current_account][self.region] diff --git a/moto/ce/models.py b/moto/ce/models.py index 7092a74c3..97938e303 100644 --- a/moto/ce/models.py +++ b/moto/ce/models.py @@ -20,7 +20,7 @@ def first_day() -> str: .replace(minute=0) .replace(second=0) ) - return iso_8601_datetime_without_milliseconds(as_date) # type: ignore[return-value] + return iso_8601_datetime_without_milliseconds(as_date) class CostCategoryDefinition(BaseModel): diff --git a/moto/cloudformation/models.py b/moto/cloudformation/models.py index beaa6019c..8d48d460e 100644 --- a/moto/cloudformation/models.py +++ b/moto/cloudformation/models.py @@ -439,7 +439,7 @@ class FakeStack(CloudFormationModel): @property def creation_time_iso_8601(self) -> str: - return iso_8601_datetime_without_milliseconds(self.creation_time) # type: ignore[return-value] + return iso_8601_datetime_without_milliseconds(self.creation_time) def _add_stack_event( self, @@ -656,7 +656,7 @@ class FakeChangeSet(BaseModel): @property def creation_time_iso_8601(self) -> str: - return iso_8601_datetime_without_milliseconds(self.creation_time) # type: ignore[return-value] + return iso_8601_datetime_without_milliseconds(self.creation_time) def diff(self) -> List[FakeChange]: changes = [] diff --git a/moto/dms/utils.py b/moto/dms/utils.py index a878e6f94..7e69b1ff3 100644 --- a/moto/dms/utils.py +++ b/moto/dms/utils.py @@ -44,9 +44,8 @@ def filter_tasks(tasks: Iterable[Any], filters: List[Dict[str, Any]]) -> Any: if not filter_function: continue - # https://github.com/python/mypy/issues/12682 matching_tasks = filter( - lambda task: filter_function(task, f["Values"]), matching_tasks # type: ignore[arg-type] + lambda task: filter_function(task, f["Values"]), matching_tasks ) return matching_tasks diff --git a/moto/dynamodb/models/table.py b/moto/dynamodb/models/table.py index 6f715a485..99a47e8eb 100644 --- a/moto/dynamodb/models/table.py +++ b/moto/dynamodb/models/table.py @@ -716,7 +716,7 @@ class Table(CloudFormationModel): possible_results.sort( key=lambda item: conv(item.attrs[index_range_key["AttributeName"]]) # type: ignore - if item.attrs.get(index_range_key["AttributeName"]) # type: ignore + if item.attrs.get(index_range_key["AttributeName"]) else None ) else: diff --git a/moto/dynamodb/parsing/key_condition_expression.py b/moto/dynamodb/parsing/key_condition_expression.py index b0a3e7ee1..11d8d8703 100644 --- a/moto/dynamodb/parsing/key_condition_expression.py +++ b/moto/dynamodb/parsing/key_condition_expression.py @@ -230,4 +230,4 @@ def validate_schema( if {"S": ""} in range_values: raise KeyIsEmptyStringException(index_range_key) - return hash_value, range_comparison, range_values # type: ignore[return-value] + return hash_value, range_comparison, range_values diff --git a/moto/ec2/models/instances.py b/moto/ec2/models/instances.py index 5dd1961ac..ce6d7a660 100644 --- a/moto/ec2/models/instances.py +++ b/moto/ec2/models/instances.py @@ -406,8 +406,8 @@ class Instance(TaggedEC2Resource, BotoInstance, CloudFormationModel): spec.instance_type == self.instance_type and spec.subnet_id == self.subnet_id ): + fleet.fulfilled_capacity -= spec.weighted_capacity break - fleet.fulfilled_capacity -= spec.weighted_capacity fleet.spot_requests = [ req for req in fleet.spot_requests if req.instance != self ] diff --git a/moto/ec2/models/security_groups.py b/moto/ec2/models/security_groups.py index bddad933d..b432cca39 100644 --- a/moto/ec2/models/security_groups.py +++ b/moto/ec2/models/security_groups.py @@ -1013,7 +1013,7 @@ class SecurityGroupBackend: if ip_ranges: for cidr in ip_ranges: if ( - isinstance(cidr, dict) # type: ignore + isinstance(cidr, dict) and not any( [ is_valid_cidr(cidr.get("CidrIp", "")), @@ -1068,7 +1068,7 @@ class SecurityGroupBackend: if ip_ranges: for cidr in ip_ranges: if ( - isinstance(cidr, dict) # type: ignore + isinstance(cidr, dict) and not any( [ is_valid_cidr(cidr.get("CidrIp", "")), diff --git a/moto/ec2/models/spot_requests.py b/moto/ec2/models/spot_requests.py index 1dbb07799..8225c17d3 100644 --- a/moto/ec2/models/spot_requests.py +++ b/moto/ec2/models/spot_requests.py @@ -371,7 +371,7 @@ class SpotFleetRequest(TaggedEC2Resource, CloudFormationModel): if new_fulfilled_capacity - spec.weighted_capacity < self.target_capacity: continue - new_fulfilled_capacity -= spec.weighted_capacity + new_fulfilled_capacity -= spec.weighted_capacity # pylint: disable=W0631 instance_ids.append(instance.id) self.spot_requests = [ diff --git a/moto/ecr/models.py b/moto/ecr/models.py index 0f4c0df09..046f96cc9 100644 --- a/moto/ecr/models.py +++ b/moto/ecr/models.py @@ -679,14 +679,14 @@ class ECRBackend(BaseBackend): found = True response["images"].append(image.response_batch_get_image) - if not found: - response["failures"].append( - { - "imageId": {"imageTag": image_id.get("imageTag", "null")}, - "failureCode": "ImageNotFound", - "failureReason": "Requested image not found", - } - ) + if not found: + response["failures"].append( + { + "imageId": {"imageTag": image_id.get("imageTag", "null")}, + "failureCode": "ImageNotFound", + "failureReason": "Requested image not found", + } + ) return response diff --git a/moto/events/models.py b/moto/events/models.py index a3d9e6a61..9c2a58be6 100644 --- a/moto/events/models.py +++ b/moto/events/models.py @@ -171,7 +171,7 @@ class Rule(CloudFormationModel): event_copy = copy.deepcopy(event) event_copy["time"] = iso_8601_datetime_without_milliseconds( - utcfromtimestamp(event_copy["time"]) + utcfromtimestamp(event_copy["time"]) # type: ignore[arg-type] ) log_stream_name = str(random.uuid4()) @@ -191,7 +191,7 @@ class Rule(CloudFormationModel): archive_name ) if archive.uuid == archive_uuid: # type: ignore[union-attr] - archive.events.append(event) # type: ignore[arg-type,union-attr] + archive.events.append(event) # type: ignore[union-attr] def _find_api_destination(self, resource_id: str) -> "Destination": backend: "EventsBackend" = events_backends[self.account_id][self.region_name] @@ -205,7 +205,7 @@ class Rule(CloudFormationModel): event_copy = copy.deepcopy(event) event_copy["time"] = iso_8601_datetime_without_milliseconds( - utcfromtimestamp(event_copy["time"]) + utcfromtimestamp(event_copy["time"]) # type: ignore[arg-type] ) if group_id: diff --git a/moto/events/notifications.py b/moto/events/notifications.py index d867f8f27..dd110ff7c 100644 --- a/moto/events/notifications.py +++ b/moto/events/notifications.py @@ -66,7 +66,7 @@ def _invoke_lambda(account_id: str, fn_arn: str, event: Any) -> None: body = json.dumps(event) get_backend(account_id, lambda_region).invoke( function_name=fn_arn, - qualifier=None, # type: ignore[arg-type] + qualifier=None, body=body, headers=dict(), response_headers=dict(), diff --git a/moto/events/utils.py b/moto/events/utils.py index 7d7e226fa..ea90f9022 100644 --- a/moto/events/utils.py +++ b/moto/events/utils.py @@ -1,7 +1,7 @@ from typing import TYPE_CHECKING, List, TypedDict if TYPE_CHECKING: - from typing_extentions import Any, Dict, Required, Union + from typing_extensions import Any, Dict, Required, Union # NOTE: Typing is based on the following document https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html diff --git a/moto/forecast/responses.py b/moto/forecast/responses.py index e824efb3e..4b28f3cf3 100644 --- a/moto/forecast/responses.py +++ b/moto/forecast/responses.py @@ -68,7 +68,7 @@ class ForecastResponse(BaseResponse): } for dsg in self.forecast_backend.list_dataset_groups() ], - key=lambda x: x["LastModificationTime"], # type: ignore + key=lambda x: x["LastModificationTime"], reverse=True, ) response = {"DatasetGroups": list_all} diff --git a/moto/iam/models.py b/moto/iam/models.py index b9f1ecdc9..f2164fe99 100644 --- a/moto/iam/models.py +++ b/moto/iam/models.py @@ -449,7 +449,7 @@ class ManagedPolicy(Policy, CloudFormationModel): return policy def __eq__(self, other: Any) -> bool: - return self.arn == other.arn # type: ignore[no-any-return] + return self.arn == other.arn def __hash__(self) -> int: return self.arn.__hash__() @@ -982,7 +982,7 @@ class InstanceProfile(CloudFormationModel): def to_embedded_config_dict(self) -> Dict[str, Any]: # Instance Profiles aren't a config item itself, but they are returned in IAM roles with - # a "config like" json structure It's also different than Role.to_config_dict() + # a "config like" json structure. It's also different than Role.to_config_dict() roles = [] for role in self.roles: roles.append( @@ -1012,7 +1012,7 @@ class InstanceProfile(CloudFormationModel): "path": self.path, "instanceProfileName": self.name, "instanceProfileId": self.id, - "arn": f"arn:aws:iam::{self.account_id}:instance-profile/{role.name}", + "arn": f"arn:aws:iam::{self.account_id}:instance-profile/{role.name}", # pylint: disable=W0631 "createDate": str(self.create_date), "roles": roles, } diff --git a/moto/inspector2/urls.py b/moto/inspector2/urls.py index 9930eb033..678e8f3cc 100644 --- a/moto/inspector2/urls.py +++ b/moto/inspector2/urls.py @@ -24,6 +24,6 @@ url_paths = { "{0}/organizationconfiguration/describe$": Inspector2Response.dispatch, "{0}/organizationconfiguration/update$": Inspector2Response.dispatch, "{0}/tags/(?P.+)$": Inspector2Response.method_dispatch( - Inspector2Response.tags # type: ignore + Inspector2Response.tags ), } diff --git a/moto/moto_proxy/proxy3.py b/moto/moto_proxy/proxy3.py index 0b34e7db1..3dbba0046 100644 --- a/moto/moto_proxy/proxy3.py +++ b/moto/moto_proxy/proxy3.py @@ -161,7 +161,7 @@ class ProxyRequestHandler(BaseHTTPRequestHandler): host=host, path=path, headers=req.headers, - body=req_body, # type: ignore[arg-type] + body=req_body, form_data=form_data, ) debug("\t=====RESPONSE========") diff --git a/moto/packages/cfnresponse/cfnresponse.py b/moto/packages/cfnresponse/cfnresponse.py index 0887c2c67..18eb3944f 100644 --- a/moto/packages/cfnresponse/cfnresponse.py +++ b/moto/packages/cfnresponse/cfnresponse.py @@ -28,7 +28,7 @@ def send( ) -> None: responseUrl = event["ResponseURL"] - print(responseUrl) + print(responseUrl) # noqa: T201 responseBody = { "Status": responseStatus, @@ -46,8 +46,8 @@ def send( json_responseBody = json.dumps(responseBody) - print("Response body:") - print(json_responseBody) + print("Response body:") # noqa: T201 + print(json_responseBody) # noqa: T201 headers = {"content-type": "", "content-length": str(len(json_responseBody))} @@ -55,8 +55,8 @@ def send( response = http.request( # type: ignore "PUT", responseUrl, headers=headers, body=json_responseBody ) - print("Status code:", response.status) + print("Status code:", response.status) # noqa: T201 except Exception as e: - print("send(..) failed executing http.request(..):", e) + print("send(..) failed executing http.request(..):", e) # noqa: T201 diff --git a/moto/panorama/models.py b/moto/panorama/models.py index b2cc62a69..db4980875 100644 --- a/moto/panorama/models.py +++ b/moto/panorama/models.py @@ -46,7 +46,7 @@ class BaseObject(BaseModel): response_object[key[0].upper() + key[1:]] = value return response_object - def response_object(self) -> Dict[str, Any]: # type: ignore[misc] + def response_object(self) -> Dict[str, Any]: return self.gen_response_object() diff --git a/moto/proxy.py b/moto/proxy.py index e6c293b02..160a2eecb 100644 --- a/moto/proxy.py +++ b/moto/proxy.py @@ -88,8 +88,8 @@ def main(argv: Any = None) -> None: sa = httpd.socket.getsockname() - print("Call `moto_proxy -h` for example invocations") - print(f"Serving HTTP Proxy on {sa[0]}:{sa[1]} ...") # noqa + print("Call `moto_proxy -h` for example invocations") # noqa: T201 + print(f"Serving HTTP Proxy on {sa[0]}:{sa[1]} ...") # noqa: T201 httpd.serve_forever() diff --git a/moto/rds/models.py b/moto/rds/models.py index 7443d2c81..460360be5 100644 --- a/moto/rds/models.py +++ b/moto/rds/models.py @@ -147,7 +147,9 @@ class Cluster: valid_engines=ClusterEngine.list_cluster_engines(), ) ) - self.engine_version = kwargs.get("engine_version") or Cluster.default_engine_version(self.engine) # type: ignore + self.engine_version = kwargs.get( + "engine_version" + ) or Cluster.default_engine_version(self.engine) self.engine_mode = kwargs.get("engine_mode") or "provisioned" self.iops = kwargs.get("iops") self.kms_key_id = kwargs.get("kms_key_id") @@ -165,7 +167,7 @@ class Cluster: self.allocated_storage = kwargs.get("allocated_storage") if self.allocated_storage is None: self.allocated_storage = Cluster.default_allocated_storage( - engine=self.engine, storage_type=self.storage_type # type: ignore + engine=self.engine, storage_type=self.storage_type ) self.master_username = kwargs.get("master_username") self.global_cluster_identifier = kwargs.get("global_cluster_identifier") @@ -609,7 +611,7 @@ class Database(CloudFormationModel): self.allocated_storage = kwargs.get("allocated_storage") if self.allocated_storage is None: self.allocated_storage = Database.default_allocated_storage( - engine=self.engine, storage_type=self.storage_type # type: ignore + engine=self.engine, storage_type=self.storage_type ) self.db_cluster_identifier: Optional[str] = kwargs.get("db_cluster_identifier") self.db_instance_identifier = kwargs.get("db_instance_identifier") @@ -617,7 +619,7 @@ class Database(CloudFormationModel): self.db_instance_class = kwargs.get("db_instance_class") self.port = kwargs.get("port") if self.port is None: - self.port = Database.default_port(self.engine) # type: ignore + self.port = Database.default_port(self.engine) self.db_instance_identifier = kwargs.get("db_instance_identifier") self.db_name = kwargs.get("db_name") self.instance_create_time = iso_8601_datetime_with_milliseconds() diff --git a/moto/redshift/models.py b/moto/redshift/models.py index 3383342c1..c4aa62f60 100644 --- a/moto/redshift/models.py +++ b/moto/redshift/models.py @@ -277,7 +277,7 @@ class Cluster(TaggableResourceMixin, CloudFormationModel): "MasterUserPassword": "****", "ClusterVersion": self.cluster_version, "VpcSecurityGroups": [ - {"Status": "active", "VpcSecurityGroupId": group.id} # type: ignore + {"Status": "active", "VpcSecurityGroupId": group.id} for group in self.vpc_security_groups ], "ClusterSubnetGroupName": self.cluster_subnet_group_name, diff --git a/moto/route53/models.py b/moto/route53/models.py index e87d44366..063081dee 100644 --- a/moto/route53/models.py +++ b/moto/route53/models.py @@ -94,13 +94,13 @@ class HealthCheck(CloudFormationModel): def set_children(self, children: Any) -> None: if children and isinstance(children, list): - self.children = children # type: ignore + self.children = children elif children and isinstance(children, str): self.children = [children] # type: ignore def set_regions(self, regions: Any) -> None: if regions and isinstance(regions, list): - self.regions = regions # type: ignore + self.regions = regions elif regions and isinstance(regions, str): self.regions = [regions] # type: ignore @@ -723,7 +723,7 @@ class Route53Backend(BaseBackend): the_zone.delete_rrset(record_set) the_zone.rr_changes.append(original_change) - @paginate(pagination_model=PAGINATION_MODEL) # type: ignore[misc] + @paginate(pagination_model=PAGINATION_MODEL) def list_hosted_zones(self) -> List[FakeZone]: """ The parameters DelegationSetId and HostedZoneType are not yet implemented diff --git a/moto/route53/responses.py b/moto/route53/responses.py index c7af8deb7..f8fa41919 100644 --- a/moto/route53/responses.py +++ b/moto/route53/responses.py @@ -249,8 +249,8 @@ class Route53(BaseResponse): elif method == "GET": querystring = parse_qs(self.parsed_url.query) template = Template(LIST_RRSET_RESPONSE) - start_type = querystring.get("type", [None])[0] # type: ignore - start_name = querystring.get("name", [None])[0] # type: ignore + start_type = querystring.get("type", [None])[0] + start_name = querystring.get("name", [None])[0] max_items = int(querystring.get("maxitems", ["300"])[0]) if start_type and not start_name: diff --git a/moto/s3/responses.py b/moto/s3/responses.py index d9ed982cb..d6eaf1705 100644 --- a/moto/s3/responses.py +++ b/moto/s3/responses.py @@ -343,7 +343,7 @@ class S3Response(BaseResponse): f"Method {method} has not been implemented in the S3 backend yet" ) - def _get_querystring(self, request: Any, full_url: str) -> Dict[str, Any]: # type: ignore[misc] + def _get_querystring(self, request: Any, full_url: str) -> Dict[str, Any]: # Flask's Request has the querystring already parsed # In ServerMode, we can use this, instead of manually parsing this if hasattr(request, "args"): @@ -1119,7 +1119,7 @@ class S3Response(BaseResponse): new_key = self.backend.put_object(bucket_name, key, f) if self.querystring.get("acl"): - acl = get_canned_acl(self.querystring["acl"][0]) # type: ignore + acl = get_canned_acl(self.querystring["acl"][0]) new_key.set_acl(acl) # Metadata @@ -1490,7 +1490,7 @@ class S3Response(BaseResponse): unquote(copy_source_parsed.path).lstrip("/").split("/", 1) ) src_version_id = parse_qs(copy_source_parsed.query).get( - "versionId", [None] # type: ignore + "versionId", [None] )[0] src_range = request.headers.get("x-amz-copy-source-range", "").split( "bytes=" @@ -1642,7 +1642,7 @@ class S3Response(BaseResponse): unquote(copy_source_parsed.path).lstrip("/").split("/", 1) ) src_version_id = parse_qs(copy_source_parsed.query).get( - "versionId", [None] # type: ignore + "versionId", [None] )[0] key_to_copy = self.backend.get_object( diff --git a/pyproject.toml b/pyproject.toml index df62231ba..9292b6a02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,8 @@ [build-system] requires = ["setuptools >= 40.6.0"] build-backend = "setuptools.build_meta" + +[tool.ruff.lint] +ignore = ["E501"] +extend-select = ["I", "T201", "T203"] + diff --git a/ruff.toml b/ruff.toml deleted file mode 100644 index 334e35f66..000000000 --- a/ruff.toml +++ /dev/null @@ -1,2 +0,0 @@ -ignore = ["E501"] -extend-select = ["I"] diff --git a/setup.cfg b/setup.cfg index 14bd1e8e2..f9cae3ec9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -268,17 +268,12 @@ markers = [coverage:run] relative_files = True -[flake8] -ignore = W503,W605,E128,E501,E203,E266,E501,E231,FS003,E704 -exclude = moto/packages,dist,tests/terraformtests - [pylint.MASTER] ignore-paths=moto/packages [pylint.'MESSAGES CONTROL'] disable = W,C,R,E -# future sensible checks = super-init-not-called, unspecified-encoding, undefined-loop-variable -enable = anomalous-backslash-in-string, arguments-renamed, dangerous-default-value, deprecated-module, function-redefined, import-self, redefined-builtin, redefined-outer-name, reimported, pointless-statement, super-with-arguments, unused-argument, unused-import, unused-variable, useless-else-on-loop, wildcard-import +enable = arguments-renamed, deprecated-module, function-redefined, redefined-outer-name, signature-differs [mypy] files= moto, tests/test_core, tests/test_batch_simple diff --git a/tests/test_dynamodb/__init__.py b/tests/test_dynamodb/__init__.py index f991188cf..fb3729acd 100644 --- a/tests/test_dynamodb/__init__.py +++ b/tests/test_dynamodb/__init__.py @@ -32,7 +32,7 @@ def dynamodb_aws_verified(create_table: bool = True): if allow_aws_request: if create_table: - print(f"Test {func} will create DynamoDB Table {table_name}") + print(f"Test {func} will create DDB Table {table_name}") # noqa return create_table_and_test(table_name) else: return func() diff --git a/tests/test_logs/test_export_tasks.py b/tests/test_logs/test_export_tasks.py index 8790adabf..8fe721355 100644 --- a/tests/test_logs/test_export_tasks.py +++ b/tests/test_logs/test_export_tasks.py @@ -157,8 +157,6 @@ def test_create_export_task_raises_ClientError_when_bucket_not_found( destination=destination, ) err = exc.value.response["Error"] - if err["Code"] != "InvalidParameterException": - print(err) assert err["Code"] == "InvalidParameterException" assert ( err["Message"] diff --git a/tests/test_s3/__init__.py b/tests/test_s3/__init__.py index e7f48e059..2a177eb21 100644 --- a/tests/test_s3/__init__.py +++ b/tests/test_s3/__init__.py @@ -31,7 +31,7 @@ def s3_aws_verified(func): ) if allow_aws_request: - print(f"Test {func} will create {bucket_name}") + print(f"Test {func} will create {bucket_name}") # noqa: T201 resp = create_bucket_and_test(bucket_name) else: with mock_aws():