instance_id string | hints_text string | patch string | test_patch string | created_at string | problem_statement string | repo string | base_commit string | version string | PASS_TO_PASS list | FAIL_TO_PASS list |
|---|---|---|---|---|---|---|---|---|---|---|
getmoto__moto-5216 | That is an oversight indeed - thanks for raising this, @whardier! | diff --git a/mypy/nodes.py b/mypy/nodes.py
--- a/mypy/nodes.py
+++ b/mypy/nodes.py
@@ -117,6 +117,7 @@ def set_line(
"__file__": "__builtins__.str",
"__package__": "__builtins__.str",
"__annotations__": None, # dict[str, Any] bounded in add_implicit_module_attrs()
+ "__spec__": None, # importlib.mac... | diff --git a/tests/test_ec2/test_vpc_service_configuration.py b/tests/test_ec2/test_vpc_service_configuration.py
--- a/tests/test_ec2/test_vpc_service_configuration.py
+++ b/tests/test_ec2/test_vpc_service_configuration.py
@@ -3,6 +3,7 @@
from botocore.exceptions import ClientError
from moto import mock_ec2, mock_e... | 2021-09-20T15:45:46Z | `import` statements under a parametrised protocol results in a crash
<!--
Use this form only if mypy reports an "INTERNAL ERROR" and/or gives a traceback.
Please include the traceback and all other messages below (use `mypy --show-traceback`).
-->
**Crash Report & Reproduction**
The following snippet will ... | getmoto/moto | bdcc6f333558f6c995591016a768ded54f9348b4 | 4.1 | [
"tests/test_ec2/test_route_tables.py::test_create_route_with_invalid_destination_cidr_block_parameter",
"tests/test_ec2/test_route_tables.py::test_routes_additional",
"tests/test_ec2/test_route_tables.py::test_describe_route_tables_with_nat_gateway",
"tests/test_ec2/test_route_tables.py::test_route_tables_def... | [
"tests/test_iot/test_iot_things.py::test_describe_thing",
"tests/test_iot/test_iot_things.py::test_create_thing"
] |
getmoto__moto-5044 | This feature hasn't been implemented yet @jordan-schneider - there is no Moto-specific way of doing this at the moment.
Would you be interesting in adding this feature?
Sorry, I'm basically flat new to S3 and have no idea what the logging format would look like. It seems like there's a solution to my request countin... | diff --git a/moto/ecr/models.py b/moto/ecr/models.py
--- a/moto/ecr/models.py
+++ b/moto/ecr/models.py
@@ -631,24 +631,24 @@ def batch_delete_image(self, repository_name, registry_id=None, image_ids=None):
else:
repository.images.remove(image)
- if not imag... | diff --git a/tests/test_route53/test_route53.py b/tests/test_route53/test_route53.py
--- a/tests/test_route53/test_route53.py
+++ b/tests/test_route53/test_route53.py
@@ -5,8 +5,9 @@
import botocore
import pytest
+import requests
-from moto import mock_ec2, mock_route53
+from moto import mock_ec2, mock_route53, s... | 2024-04-08 20:11:46 | Use execution parameters in Athena backend
I'm trying to update the AthenaBackend, so I will be able to create a mock based on common SQL statements I use in my tests.
I changes the start_query_execution and get_query_results methods, and it works well for me.
I'm missing in both statements the query execution para... | python/mypy | f8c2b621dbb281a2025bcc8db9231ad89ea459d8 | 4.1 | [
"mypy/test/testcheck.py::TypeCheckSuite::testUnimportedHintAnyLower",
"mypy/test/testcheck.py::TypeCheckSuite::testUnimportedHintAny"
] | [
"tests/test_sts/test_sts.py::test_assume_role_with_web_identity_boto3[cn-north-1-aws-cn]",
"tests/test_sts/test_sts.py::test_get_caller_identity_with_assumed_role_credentials[cn-north-1-aws-cn]",
"tests/test_sts/test_sts.py::test_assume_role[cn-north-1-aws-cn]",
"tests/test_sts/test_sts.py::test_get_caller_id... |
python__mypy-15131 | Thanks for raising this @Bharat23! Marking it as an enhancement to mock the failure case correctly.
> If a classic load balancer doesn't exist, boto3 raises AccessPointNotFoundException which basically means that the load balancer being queried does not exist.
>
As far as I can tell, AWS throws a LoadBalancerNotFou... | diff --git a/mypy/checker.py b/mypy/checker.py
--- a/mypy/checker.py
+++ b/mypy/checker.py
@@ -24,9 +24,9 @@
Context, Decorator, PrintStmt, BreakStmt, PassStmt, ContinueStmt,
ComparisonExpr, StarExpr, EllipsisExpr, RefExpr, PromoteExpr,
Import, ImportFrom, ImportAll, ImportBase, TypeAlias,
- ARG_POS, ... | diff --git a/tests/test_identitystore/test_identitystore.py b/tests/test_identitystore/test_identitystore.py
--- a/tests/test_identitystore/test_identitystore.py
+++ b/tests/test_identitystore/test_identitystore.py
@@ -560,6 +560,61 @@ def test_list_group_memberships():
next_token = list_response["NextToke... | 2022-06-22 22:14:44 | multi part upload with empty part list should be rejected
# Steps to reproduce
```
from moto import mock_s3
import boto3
bucket = 'mybucket'
key = 'test-multi-empty'
if True:
mock_s3().start()
client = boto3.client('s3')
client.create_bucket(
Bucket=bucket,
CreateBucke... | getmoto/moto | dc460a325839bc6797084a54afc297a2c9d87e63 | 4.2 | [
"tests/test_s3/test_s3_auth.py::test_load_unexisting_object_without_auth_should_return_403",
"tests/test_s3/test_s3_auth.py::test_delete_objects_without_access_throws_custom_error",
"tests/test_s3/test_s3_auth.py::test_head_bucket_with_incorrect_credentials"
] | [
"tests/test_cognitoidp/test_cognitoidp.py::test_create_resource_server_with_no_scopes"
] |
getmoto__moto-6178 | Okay, so while https://github.com/python/mypy/pull/12023 fixed a bunch of crashes, it also resulted in some new crashes. It also looks like there's some kind of caching bug at play, so make sure to use `--no-incremental` if you're seeing weirdness when debugging.
```
λ mypy -c 'class Foo: from os import *' --show-t... | diff --git a/moto/dynamodb/responses.py b/moto/dynamodb/responses.py
--- a/moto/dynamodb/responses.py
+++ b/moto/dynamodb/responses.py
@@ -434,6 +434,12 @@ def get_item(self):
name = self.body["TableName"]
self.dynamodb_backend.get_table(name)
key = self.body["Key"]
+ empty_keys = [k f... | diff --git a/tests/terraformtests/terraform-tests.failures.txt b/tests/terraformtests/terraform-tests.failures.txt
--- a/tests/terraformtests/terraform-tests.failures.txt
+++ b/tests/terraformtests/terraform-tests.failures.txt
@@ -1,7 +1,6 @@
# The Tests in this file worked against an older version of Terraform
# Eit... | 2022-06-07T14:35:44Z | Module ELB: object has no attribute 'instance_ids'
I am using the `elb` client and need to describe the instance health associated with it. The code uses `describe_instance_health`.
I am testing the use case where the ELB provided is invalid or does not exist. To do that I create a loadbalancer as a pre-requisite an... | getmoto/moto | 197e8710afcd311cf3845811dccdea7535711feb | 4.0 | [
"tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_query_gsi_with_wrong_key_attribute_names_throws_exception",
"tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_update_primary_key",
"tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_creating_table_with_0_local_index... | [
"tests/test_athena/test_athena.py::test_get_query_execution_with_execution_parameters"
] |
python__mypy-15050 | diff --git a/moto/dynamodb/models/table.py b/moto/dynamodb/models/table.py
--- a/moto/dynamodb/models/table.py
+++ b/moto/dynamodb/models/table.py
@@ -484,10 +484,12 @@ def _validate_key_sizes(self, item_attrs: Dict[str, Any]) -> None:
if DynamoType(range_value).size() > RANGE_KEY_MAX_LENGTH:
... | diff --git a/test-data/unit/check-python311.test b/test-data/unit/check-python311.test
--- a/test-data/unit/check-python311.test
+++ b/test-data/unit/check-python311.test
@@ -142,3 +142,34 @@ myclass3 = MyClass(float, float, float) # E: No overload variant of "MyClass" m
# N: ... | 2024-03-26 20:36:45 | earliestRestorableTime missing from result rds.describe_db_cluster
`rds.describe_db_clusters` is not returning the property `earliestRestorableTime` when the cluster has a snapshot
| python/mypy | 13bd201586e837962239dbdca8eda1f9966ebfc2 | 3.1 | [
"tests/test_awslambda/test_lambda_policy.py::test_get_function_policy[FunctionArn]",
"tests/test_awslambda/test_lambda_policy.py::test_get_function_policy[FunctionName]",
"tests/test_awslambda/test_lambda_policy.py::test_get_unknown_policy",
"tests/test_awslambda/test_lambda_policy.py::test_get_policy_with_qu... | [
"tests/test_s3/test_s3.py::test_restore_key_transition"
] | |
getmoto__moto-5058 | Thanks for raising this @pawelarybak - marking it as an enhancement to add validation for this use-case | diff --git a/moto/ec2/models/instances.py b/moto/ec2/models/instances.py
--- a/moto/ec2/models/instances.py
+++ b/moto/ec2/models/instances.py
@@ -112,6 +112,7 @@ def __init__(self, ec2_backend, image_id, user_data, security_groups, **kwargs):
self.instance_initiated_shutdown_behavior = (
kwargs.g... | diff --git a/tests/test_core/test_decorator_calls.py b/tests/test_core/test_decorator_calls.py
--- a/tests/test_core/test_decorator_calls.py
+++ b/tests/test_core/test_decorator_calls.py
@@ -159,6 +159,26 @@ def test_should_not_find_bucket(self):
s3.head_bucket(Bucket="mybucket")
+@mock_s3
+class Basec... | 2022-08-14 11:11:51 | Untyped functions content show up in mypy output
**Bug Report**
For default configuration, violations can be reported in untyped (shouldn't be checked) functions.
**To Reproduce**
```
def f():
return UNDEFINED
def g():
return lambda x: UNDEFINED in x
```
https://mypy-play.net/?mypy=latest&p... | python/mypy | 66b48cbe97bf9c7660525766afe6d7089a984769 | 3.0 | [] | [
"mypy/test/testcheck.py::TypeCheckSuite::testEnumReachabilityWithMultipleEnums",
"mypy/test/testcheck.py::TypeCheckSuite::testEnumNarrowedToTwoLiterals"
] |
python__mypy-12023 | diff --git a/moto/cloudwatch/models.py b/moto/cloudwatch/models.py
--- a/moto/cloudwatch/models.py
+++ b/moto/cloudwatch/models.py
@@ -665,7 +665,10 @@ def list_tags_for_resource(self, arn):
return self.tagger.get_tag_dict_for_resource(arn)
def tag_resource(self, arn, tags):
- if arn not in self.... | diff --git a/tests/test_ec2/test_spot_fleet.py b/tests/test_ec2/test_spot_fleet.py
--- a/tests/test_ec2/test_spot_fleet.py
+++ b/tests/test_ec2/test_spot_fleet.py
@@ -118,8 +118,7 @@ def test_create_spot_fleet_with_lowest_price():
launch_spec["UserData"].should.equal("some user data")
launch_spec["WeightedCap... | 2023-06-30 21:22:44 | DynamoDB put_item SerializationException when any key inside the Item is 'S'
Hey everyone, thanks for the all the great work on this library. It makes unit testing a breeze!
I ran into a bit of a strange issue with the Table.put_item() method in a mock DynamoDB table. It looks like if any key inside the item (inclu... | getmoto/moto | dbb72bb92cd45939364312e84271ce4ecad2820b | 4.0 | [
"mypy/test/testcheck.py::TypeCheckSuite::check-functions.test::requireExplicitOverrideMultipleInheritance",
"mypy/test/testcheck.py::TypeCheckSuite::check-functions.test::explicitOverrideClassmethod",
"mypy/test/testcheck.py::TypeCheckSuite::check-functions.test::explicitOverrideStaticmethod",
"mypy/test/test... | [
"mypy/test/testsemanal.py::SemAnalSuite::testLambdaInheritsCheckedContextFromFuncLambdaStack",
"mypy/test/testsemanal.py::SemAnalSuite::testLambdaInheritsCheckedContextFromFunc"
] | |
getmoto__moto-5731 | Thanks for raising this @Bharat23 - marking it as an enhancement to implement this validation.
Just as an implementation note: the docs state that `If you do not specify a cluster, the default cluster is assumed.` Which means that the same error may be raised if you do not specify a cluster, and the `default` cluste... | diff --git a/moto/core/utils.py b/moto/core/utils.py
--- a/moto/core/utils.py
+++ b/moto/core/utils.py
@@ -390,3 +390,11 @@ def params_sort_function(item: Tuple[str, Any]) -> Tuple[str, int, str]:
def gzip_decompress(body: bytes) -> bytes:
return decompress(body)
+
+
+def get_partition_from_region(region_name: ... | diff --git a/tests/terraform-tests.success.txt b/tests/terraform-tests.success.txt
--- a/tests/terraform-tests.success.txt
+++ b/tests/terraform-tests.success.txt
@@ -10,6 +10,9 @@ TestAccAWSAPIGatewayV2RouteResponse
TestAccAWSAPIGatewayV2VpcLink
TestAccAWSAppsyncApiKey
TestAccAWSAppsyncGraphqlApi
+TestAccAWSAutosca... | 2022-01-26 23:16:33 | DynamoDB: special characters in get_item() projection expression not handled correctly
Hi!
I have a nested attribute inside a dynamodb table like so:
````json
{
"device": {
"N": "123456"
},
"software": {
"M": {
"python3.10": {
"M": {
... | getmoto/moto | 99fae38db80e2d2778c5d11e61463100342818ad | 1.0 | [
"tests/test_logs/test_logs.py::test_create_log_group[arn:aws:kms:us-east-1:000000000000:key/51d81fab-b138-4bd2-8a09-07fd6d37224d]",
"tests/test_logs/test_logs.py::test_describe_log_streams_invalid_order_by[LogStreamname]",
"tests/test_logs/test_logs.py::test_create_log_group_invalid_name_length[513]",
"tests/... | [
"tests/test_s3/test_s3_auth.py::test_head_bucket_with_correct_credentials"
] |
getmoto__moto-5969 | Thanks for letting us know @linhmeobeo - will raise a PR to fix this shortly | diff --git a/moto/cognitoidp/models.py b/moto/cognitoidp/models.py
--- a/moto/cognitoidp/models.py
+++ b/moto/cognitoidp/models.py
@@ -578,6 +578,14 @@ def get_user_extra_data_by_client_id(self, client_id, username):
extra_data.update({attribute[0]["Name"]: attribute[0]["Value"]})
return e... | diff --git a/tests/test_secretsmanager/test_secretsmanager.py b/tests/test_secretsmanager/test_secretsmanager.py
--- a/tests/test_secretsmanager/test_secretsmanager.py
+++ b/tests/test_secretsmanager/test_secretsmanager.py
@@ -547,17 +547,26 @@ def test_describe_secret():
@mock_secretsmanager
-def test_describe_se... | 2023-08-30T06:04:13Z | S3 `upload_part` fails for version 4.2.5
## Description
I am creating a S3 multipart upload and generating a presigned url for uploading the parts. The user can then call `requests.put(url, data=data)` on the presigned url to upload the parts.
The following test passes on `moto==4.2.4` but fails on `4.2.5` with `... | getmoto/moto | d20da03225d563849e7b1457a30692ddd86ab911 | 4.0 | [
"tests/test_ec2/test_subnets.py::test_describe_subnets_dryrun",
"tests/test_ec2/test_ec2_cloudformation.py::test_multiple_security_group_ingress_separate_from_security_group_by_id",
"tests/test_elbv2/test_elbv2.py::test_modify_listener_http_to_https",
"tests/test_ec2/test_subnets.py::test_available_ip_address... | [
"tests/test_s3/test_s3_config.py::test_s3_public_access_block_to_config_dict"
] |
getmoto__moto-6332 | Hi @MacHu-GWU, that attribute should be calculated inside the `LayerVersion`-class:
https://github.com/getmoto/moto/blob/368fa07ec35aa6806c839a1f4883426159179127/moto/awslambda/models.py#L371
If the S3 file exists, it will use that information.
If it does not exist, it will throw an error (`The specified bucket d... | diff --git a/mypy/constraints.py b/mypy/constraints.py
--- a/mypy/constraints.py
+++ b/mypy/constraints.py
@@ -177,8 +177,9 @@ def infer_constraints(template: Type, actual: Type, direction: int) -> list[Cons
for (t, a) in reversed(TypeState.inferring)
):
return []
- if has_recursive_types(temp... | diff --git a/test-data/unit/stubgen.test b/test-data/unit/stubgen.test
--- a/test-data/unit/stubgen.test
+++ b/test-data/unit/stubgen.test
@@ -2932,6 +2932,18 @@ class Y(TypedDict, total=False):
a: int
b: str
+[case testTypeddictClassWithKeyword]
+from typing import TypedDict
+class MyDict(TypedDict, total=... | 2023-02-19 22:49:41 | Dynamodb query with a KeyConditionExpression should raise ClientError when the partition key is empty
Moto Version: 4.2.9
In an almost identical situation to https://github.com/getmoto/moto/issues/5345, which was about this issue when using `get_item`, when using `query` instead with a KeyConditionExpression the sam... | python/mypy | f2978c3b1b23ea939db58332f94876b73bc01d65 | 3.1 | [
"tests/test_sesv2/test_sesv2.py::test_create_contact_list__with_topics",
"tests/test_sesv2/test_sesv2.py::test_send_raw_email__with_to_address_display_name",
"tests/test_sesv2/test_sesv2.py::test_create_contact",
"tests/test_sesv2/test_sesv2.py::test_delete_contact_no_contact_list",
"tests/test_sesv2/test_s... | [
"mypy/test/testcheck.py::TypeCheckSuite::check-protocols.test::testProtocolImportNotMember"
] |
getmoto__moto-7270 | diff --git a/mypy/semanal.py b/mypy/semanal.py
--- a/mypy/semanal.py
+++ b/mypy/semanal.py
@@ -91,7 +91,7 @@
FunctionLike, UnboundType, TypeVarType, TupleType, UnionType, StarType,
CallableType, Overloaded, Instance, Type, AnyType, LiteralType, LiteralValue,
TypeTranslator, TypeOfAny, TypeType, NoneType,... | diff --git a/tests/test_sns/test_sns_cloudformation.py b/tests/test_sns/test_sns_cloudformation.py
--- a/tests/test_sns/test_sns_cloudformation.py
+++ b/tests/test_sns/test_sns_cloudformation.py
@@ -1,6 +1,7 @@
import boto3
import json
import sure # noqa # pylint: disable=unused-import
+import pytest
from moto i... | 2023-11-07 04:54:39 | Quirk with @staticmethod decorator on __new__
**Bug Report**
(To be fair, this might be a slight quirk in PEP 673 rather than a bug mypy's implementation).
Certain dunderscored methods are implicitly static, such as `__new__`. Personally, I prefer to be explicit and so I would like to decorate such methods with `... | getmoto/moto | c134afaf60517c773c6b198427c031d9356825e6 | 1.6 | [
"tests/test_glue/test_datacatalog.py::test_delete_database",
"tests/test_glue/test_datacatalog.py::test_create_partition_already_exist",
"tests/test_glue/test_datacatalog.py::test_get_partitions_empty",
"tests/test_glue/test_datacatalog.py::test_create_database",
"tests/test_glue/test_datacatalog.py::test_b... | [
"mypy/test/testcheck.py::TypeCheckSuite::check-dataclass-transform.test::testDataclassTransformGenericDescriptor",
"mypy/test/testcheck.py::TypeCheckSuite::check-dataclass-transform.test::testDataclassTransformUnsupportedDescriptors",
"mypy/test/testcheck.py::TypeCheckSuite::check-dataclass-transform.test::test... | |
python__mypy-17293 | Anyway, it is weird that `from typing import Union` is not inserted by stubgen...
@eggplants if stubgen doesn't import Union when it should, please open a separate issue with a reproducer. We should definitely fix that, and I suspect it'll be easy.
I'm a little more uncertain about this issue, since mypy still has a... | diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py
--- a/mypy/checkexpr.py
+++ b/mypy/checkexpr.py
@@ -2166,15 +2166,7 @@ def check_arg(
if isinstance(caller_type, DeletedType):
self.msg.deleted_as_rvalue(caller_type, context)
# Only non-abstract non-protocol class can be given where Type... | diff --git a/tests/test_stepfunctions/test_stepfunctions.py b/tests/test_stepfunctions/test_stepfunctions.py
--- a/tests/test_stepfunctions/test_stepfunctions.py
+++ b/tests/test_stepfunctions/test_stepfunctions.py
@@ -950,6 +950,12 @@ def test_state_machine_get_execution_history_contains_expected_failure_events_wh
... | 2023-04-08 21:14:28 | IoT delete_certificate() "forceDelete" param does not work
# Summary
The `forceDelete` parameter in the iot implementation is not congruent with boto3 behavior.
## Steps to reproduce
Run the following python code:
```python
import json
import boto3
from moto import mock_iot
IOT_THING_POLICY_NAME = "ThingC... | python/mypy | a7e0f6f8b0ec5de2fe7b804c9ac7160893ae5bf8 | 1.7 | [] | [
"tests/test_autoscaling/test_launch_configurations.py::test_launch_config_with_block_device_mappings__volumes_are_created",
"tests/test_autoscaling/test_autoscaling.py::test_create_template_with_block_device"
] |
getmoto__moto-5348 | Hey @nicor88, thanks for raising this. The `VersionId` should actually be returned twice, according to the AWS docs: once as part of the key of Table, and one separate. :confused:
Marking it as a bug.
@bblommers ah I see, as mentioned above also UpdateTime seems missing. | diff --git a/mypy/binder.py b/mypy/binder.py
--- a/mypy/binder.py
+++ b/mypy/binder.py
@@ -51,6 +51,9 @@ def __init__(self, id: int, conditional_frame: bool = False) -> None:
# need this field.
self.suppress_unreachable_warnings = False
+ def __repr__(self) -> str:
+ return f"Frame({self.i... | diff --git a/tests/test_core/test_moto_api.py b/tests/test_core/test_moto_api.py
--- a/tests/test_core/test_moto_api.py
+++ b/tests/test_core/test_moto_api.py
@@ -14,6 +14,7 @@
if settings.TEST_SERVER_MODE
else "http://motoapi.amazonaws.com"
)
+data_url = f"{base_url}/moto-api/data.json"
@mock_sqs
@@ -3... | 2022-03-20 23:57:28 | SSM `describe_parameters` `ParameterFilters` fails when `Values` is not provided
Hi,
I'm using Moto to mock the SSM client and am running into an error. One of my filters does not have a value which causes Moto to throw an error, but the real code works fine.
With this code:
```py
paginator = ssm.get_paginat... | getmoto/moto | 121e3eadb821955c74b5ab61b8cfbef7328e7592 | 1.4 | [
"tests/test_scheduler/test_scheduler.py::test_list_schedules",
"tests/test_scheduler/test_scheduler.py::test_create_get_schedule",
"tests/test_scheduler/test_scheduler.py::test_create_duplicate_schedule",
"tests/test_scheduler/test_scheduler.py::test_create_get_delete__in_different_group",
"tests/test_sched... | [
"tests/test_awslambda/test_lambda.py::test_multiple_qualifiers",
"tests/test_awslambda/test_lambda_alias.py::test_get_function_using_alias"
] |
python__mypy-11267 | Hi @jlewis92! Thanks for raising this. Moto seems to think that `SomeColumn` is a range key, so the validation error is us complaining that the `update_item`-operation is not providing that key. Marking it as a bug. | diff --git a/moto/cognitoidp/models.py b/moto/cognitoidp/models.py
--- a/moto/cognitoidp/models.py
+++ b/moto/cognitoidp/models.py
@@ -909,7 +909,7 @@ def to_json(self) -> Dict[str, Any]:
"Name": self.name,
}
- if len(self.scopes) != 0:
+ if self.scopes:
res.update({"S... | diff --git a/tests/test_kms/test_kms_boto3.py b/tests/test_kms/test_kms_boto3.py
--- a/tests/test_kms/test_kms_boto3.py
+++ b/tests/test_kms/test_kms_boto3.py
@@ -43,19 +43,6 @@ def test_create_key_without_description():
metadata.should.have.key("Description").equal("")
-@mock_kms
-def test_create_key_with_emp... | 2022-11-28 23:14:55 | Secret ARNs should have 6 random characters at end, not 5
When you create a secret in AWS secrets manager, the ARN is what you'd expect, plus `-xxxxxx`, where `x` is random characters.
Moto already adds random characters, but 5 instead of 6 (excluding the hyphen).
For context, I'm testing code which is asserting ... | getmoto/moto | b13e493823397d3c9aae3598b3b024307f6b0974 | 1.4 | [
"mypy/test/testcheck.py::TypeCheckSuite::check-inference.test::testRegression11705_Strict"
] | [
"tests/test_cloudfront/test_cloudfront_invalidation.py::test_list_invalidations__no_entries"
] |
getmoto__moto-6106 | Thanks for raising this @zellio - looks like this was introduced with #6342. When creating images, we don't correctly search if the tag exists in images with multiple tags, and we also do not re-assign/remove the tag if it exists in an existing manifest.
Will raise a PR shortly. | diff --git a/moto/core/utils.py b/moto/core/utils.py
--- a/moto/core/utils.py
+++ b/moto/core/utils.py
@@ -416,6 +416,8 @@ def __contains__(self, item):
return item in self.regions or item in self.keys()
def __getitem__(self, item):
+ if item in self.keys():
+ return super().__getitem_... | diff --git a/tests/test_dynamodb/models/test_item.py b/tests/test_dynamodb/models/test_item.py
--- a/tests/test_dynamodb/models/test_item.py
+++ b/tests/test_dynamodb/models/test_item.py
@@ -34,17 +34,17 @@ def _project(self, expression, result):
assert x == y
def test_find_nothing(self):
- self.... | 2023-09-01 18:25:54 | lambda get_function() returns config working directory in error
Thanks for the recent fix, but I've spotted another problem/corner case in moto 4.1.14.
In the case where a function's `ImageConfig` dict does not contain a working directory definition, it is not reported by `get_function()`. For example:
```
>>> i... | getmoto/moto | 197e8710afcd311cf3845811dccdea7535711feb | 0.920 | [
"tests/test_dynamodb/test_dynamodb.py::test_remove_list_index__remove_existing_nested_index",
"tests/test_dynamodb/test_dynamodb.py::test_list_table_tags_paginated",
"tests/test_dynamodb/test_dynamodb_table_without_range_key.py::test_update_item_conditions_fail_because_expect_not_exists_by_compare_to_null",
"... | [
"tests/test_iot/test_iot_search.py::test_search_things[thingName:ab?-results3]",
"tests/test_iot/test_iot_search.py::test_search_things[abc-results0]",
"tests/test_iot/test_iot_search.py::test_search_things[thingName:abc-results1]",
"tests/test_iot/test_iot_search.py::test_search_things[*-results4]",
"tests... |
getmoto__moto-5504 | diff --git a/moto/apigateway/models.py b/moto/apigateway/models.py
--- a/moto/apigateway/models.py
+++ b/moto/apigateway/models.py
@@ -5,6 +5,7 @@
import responses
import requests
import time
+from datetime import datetime
from collections import defaultdict
from openapi_spec_validator import validate_spec
from t... | diff --git a/tests/test_stepfunctions/parser/__init__.py b/tests/test_stepfunctions/parser/__init__.py
--- a/tests/test_stepfunctions/parser/__init__.py
+++ b/tests/test_stepfunctions/parser/__init__.py
@@ -76,7 +76,7 @@ def verify_execution_result(
)
for _ in range(10):
execution = client.describe_e... | 2023-03-27 23:48:40 | ACM certificate does not work with subject alternative names
# Problem
I am unable to successfully run the following Terraform code when the `subject_alternative_names` param is passed to the `aws_acm_certificate` resource. Terraform also shows that there are changes every run due to switching values from the default ... | getmoto/moto | 178f2b8c03d7bf45ac520b3c03576e6a17494b5c | 1.5 | [] | [
"tests/test_s3/test_server.py::test_s3_server_bucket_create[bar+baz]",
"tests/test_s3/test_server.py::test_s3_server_bucket_create[bar_baz]",
"tests/test_s3/test_server.py::test_s3_server_bucket_create[baz"
] | |
getmoto__moto-6238 | diff --git a/mypy/semanal.py b/mypy/semanal.py
--- a/mypy/semanal.py
+++ b/mypy/semanal.py
@@ -2748,6 +2748,13 @@ def analyze_name_lvalue(self,
existing = names.get(name)
outer = self.is_global_or_nonlocal(name)
+ if kind == MDEF and isinstance(self.type, TypeInfo) and self.type.is_enum:
+ ... | diff --git a/tests/test_dynamodb/test_dynamodb.py b/tests/test_dynamodb/test_dynamodb.py
--- a/tests/test_dynamodb/test_dynamodb.py
+++ b/tests/test_dynamodb/test_dynamodb.py
@@ -4708,6 +4708,17 @@ def test_gsi_projection_type_include():
}
)
+ # Same when scanning the table
+ items = table.scan(In... | 2023-01-14 13:32:52 | ignore-missing-import option does not work on false positive "Library stubs not installed for X"
**Bug Report**
Sometimes, multiple packages on pypi will share a namespace once installed. One example pair is [`google-cloud-storage`](https://pypi.org/project/google-cloud-storage/) and [`protobuf`](https://pypi.org/pr... | getmoto/moto | 27d2c2212547f137ade8b2098902a8c80ca82f78 | 0.940 | [
"mypy/test/testcheck.py::TypeCheckSuite::testAssignToTypeGuardedVariable3",
"mypy/test/testcheck.py::TypeCheckSuite::testTypeGuardUnionOut",
"mypy/test/testcheck.py::TypeCheckSuite::testTypeGuardUnionIn"
] | [
"mypy/test/testcheck.py::TypeCheckSuite::testTypeVarBoundToUnionAttributeAccess"
] | |
python__mypy-10712 | Thanks for raising this @andypaterson40 - looks like we're not doing anything with the `launchTemplate` at the moment, we just store it as is. Will mark it as an enhancement to actually verify it exists and retrieve the corresponding name/id. | diff --git a/moto/events/models.py b/moto/events/models.py
--- a/moto/events/models.py
+++ b/moto/events/models.py
@@ -33,6 +33,9 @@
from .utils import PAGINATION_MODEL
+# Sentinel to signal the absence of a field for `Exists` pattern matching
+UNDEFINED = object()
+
class Rule(CloudFormationModel):
Arn = ... | diff --git a/tests/test_resourcegroupstaggingapi/test_resourcegroupstaggingapi.py b/tests/test_resourcegroupstaggingapi/test_resourcegroupstaggingapi.py
--- a/tests/test_resourcegroupstaggingapi/test_resourcegroupstaggingapi.py
+++ b/tests/test_resourcegroupstaggingapi/test_resourcegroupstaggingapi.py
@@ -422,6 +422,50... | 2022-03-27 22:39:37 | __post_init__() causes INTERNAL ERROR
**Crash Report**
When I code with `def __post_init__()`, mypy reports INTERNAL ERROR.
**To Reproduce**
Here is a minimal code snippet to reproduce the crash:
```
def __post_init__(self):
self._a = a
```
Print the code in the `file.py` and execute `mypy file.py`.
... | getmoto/moto | adfbff1095e611eeff417321559db048f072478a | 4.0 | [
"mypy/test/testcheck.py::TypeCheckSuite::check-modules.test::testMissingSubmoduleOfInstalledStubPackageIgnored"
] | [
"mypy/test/testcheck.py::TypeCheckSuite::testNarrowingExprPropagation"
] |
getmoto__moto-7584 | Thanks for raising this @tekumara - marking it as an enhancement to add this attribute. | diff --git a/moto/autoscaling/models.py b/moto/autoscaling/models.py
--- a/moto/autoscaling/models.py
+++ b/moto/autoscaling/models.py
@@ -163,7 +163,8 @@ def create_from_instance(cls, name, instance, backend):
spot_price=None,
ebs_optimized=instance.ebs_optimized,
associate_publi... | diff --git a/tests/test_organizations/organizations_test_utils.py b/tests/test_organizations/organizations_test_utils.py
--- a/tests/test_organizations/organizations_test_utils.py
+++ b/tests/test_organizations/organizations_test_utils.py
@@ -135,17 +135,3 @@ def validate_service_control_policy(org, response):
res... | 2023-12-29 06:22:47 | Mock CloudFront Response Missing Something for Botocore Parser
#Mock CloudFront Response Missing Something for Botocore Parser
## Description of Issue:
When running the code below, the following exception is raised when using the moto library to mock out the call. When used "live" to actually create and test upd... | getmoto/moto | 65611082be073018a898ae795a0a7458cf2ac9f2 | 5.0 | [
"tests/test_cognitoidp/test_cognitoidp.py::test_create_user_pool_custom_attribute_required",
"tests/test_cognitoidp/test_cognitoidp.py::test_admin_confirm_sign_up",
"tests/test_cognitoidp/test_cognitoidp.py::test_get_user_unknown_accesstoken",
"tests/test_cognitoidp/test_cognitoidp.py::test_update_user_pool",... | [
"tests/test_iam/test_iam_groups.py::test_get_all_groups"
] |
python__mypy-11213 | Welcome to Moto @lweijl! Marking it as an enhancement to add this header. | diff --git a/mypy/checker.py b/mypy/checker.py
--- a/mypy/checker.py
+++ b/mypy/checker.py
@@ -3859,9 +3859,10 @@ def intersect_instances(self,
def _get_base_classes(instances_: Tuple[Instance, Instance]) -> List[Instance]:
base_classes_ = []
for inst in instances_:
- e... | diff --git a/tests/test_rds/test_rds.py b/tests/test_rds/test_rds.py
--- a/tests/test_rds/test_rds.py
+++ b/tests/test_rds/test_rds.py
@@ -2019,3 +2019,39 @@ def test_create_db_instance_with_tags():
resp = client.describe_db_instances(DBInstanceIdentifier=db_instance_identifier)
resp["DBInstances"][0]["TagL... | 2023-04-01 19:01:55 | [dynamodb] Incorrect handling of array indices when removing multiple items from a list attribute
## [dynamodb] Incorrect handling of array indices when removing multiple items from a list attribute
We have noticed an issue with the dynamodb mock implementation related to update-queries with a remove-expression, in ... | getmoto/moto | a1a74fe4bb8ac4e094bf6345da461bae21791e95 | 0.920 | [
"tests/test_ec2/test_route_tables.py::test_route_table_associations",
"tests/test_ec2/test_route_tables.py::test_route_tables_defaults",
"tests/test_ec2/test_route_tables.py::test_routes_vpn_gateway",
"tests/test_ec2/test_route_tables.py::test_create_route_with_network_interface_id",
"tests/test_ec2/test_ro... | [
"tests/test_rds/test_rds_clusters.py::test_describe_db_cluster_after_creation"
] |
getmoto__moto-6204 | Hi @dkatzbuc, thanks for raising this - doesn't look like this behaviour is implemented yet. Marking it as an enhancement. | diff --git a/moto/ec2/models.py b/moto/ec2/models.py
--- a/moto/ec2/models.py
+++ b/moto/ec2/models.py
@@ -4142,7 +4142,7 @@ def delete_vpc_endpoints(self, vpce_ids=None):
for vpce_id in vpce_ids or []:
vpc_endpoint = self.vpc_end_points.get(vpce_id, None)
if vpc_endpoint:
- ... | diff --git a/test-data/unit/check-literal.test b/test-data/unit/check-literal.test
--- a/test-data/unit/check-literal.test
+++ b/test-data/unit/check-literal.test
@@ -1872,8 +1872,9 @@ reveal_type(tup2[idx3]) # N: Revealed type is "__main__.D"
reveal_type(tup2[idx4]) # N: Revealed type is "__main__.E"
rev... | 2022-05-12 11:14:55 | Implement state transitions for ECS tasks

* https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-lifecycle.html
* https://boto3.amazonaws.com/v1/documentation/api/1.28.1/reference/services/ecs/waiter/... | getmoto/moto | 5c2fc55ea1d2975d5be50dead4f9b49d76feec8b | 0.970 | [] | [
"tests/test_ses/test_ses_boto3.py::test_set_identity_mail_from_domain"
] |
getmoto__moto-4787 | diff --git a/moto/dynamodb/parsing/key_condition_expression.py b/moto/dynamodb/parsing/key_condition_expression.py
--- a/moto/dynamodb/parsing/key_condition_expression.py
+++ b/moto/dynamodb/parsing/key_condition_expression.py
@@ -160,8 +160,10 @@ def parse_expression(
if crnt_char == "(":
# hashk... | diff --git a/test-data/unit/check-classes.test b/test-data/unit/check-classes.test
--- a/test-data/unit/check-classes.test
+++ b/test-data/unit/check-classes.test
@@ -1367,6 +1367,54 @@ a = A()
a.f = ''
a.f = 1 # E: Incompatible types in assignment (expression has type "int", variable has type "str")
+[case testSet... | 2023-04-18 11:40:23 | Support `SM2DSA` signing algorithm for KMS
Let's add `SM2DSA` signing algorithm for kms.
KMS document: https://docs.aws.amazon.com/kms/latest/APIReference/API_Sign.html#API_Sign_RequestSyntax
Supported algorithms:
```
RSASSA_PSS_SHA_256 | RSASSA_PSS_SHA_384 | RSASSA_PSS_SHA_512 | RSASSA_PKCS1_V1_5_SHA_256 | RSASS... | python/mypy | 6c1eb5b36b83ecf959a50100d282ca86186f470f | 4.1 | [
"tests/test_sns/test_sns_cloudformation.py::test_sns_delete_topic[True]",
"tests/test_sns/test_sns_cloudformation.py::test_sns_update_remove_topic[True]",
"tests/test_sns/test_sns_cloudformation.py::test_sns_update_topic",
"tests/test_sns/test_sns_cloudformation.py::test_sns_topic"
] | [
"mypy/test/testcheck.py::TypeCheckSuite::testExplicitReexportImportCycleWildcard"
] | |
python__mypy-15976 | Hi,
This would be my first time contributing to this repo. Can I take this up ?
Sure, give it a try. Read CONTRIBUTING.md to get started.
I took a look at this issue recently. The problem is reproduced not only on "init" but for empty function as well.
With next samples:
```python
a = 2
a.__pow__()
class ... | diff --git a/moto/apigateway/models.py b/moto/apigateway/models.py
--- a/moto/apigateway/models.py
+++ b/moto/apigateway/models.py
@@ -1734,7 +1734,7 @@ def create_resource(
if not path_part:
# We're attempting to create the default resource, which already exists.
return api.default
-... | diff --git a/tests/test_iotdata/test_iotdata.py b/tests/test_iotdata/test_iotdata.py
--- a/tests/test_iotdata/test_iotdata.py
+++ b/tests/test_iotdata/test_iotdata.py
@@ -112,14 +112,14 @@ def test_publish():
client = boto3.client("iot-data", region_name=region_name)
client.publish(topic="test/topic1", qos=1,... | 2022-05-10 22:53:00 | mock_cloudformation: Wrong ExecutionStatus, Status and StatusReason when creating a change set with no changes.
Hello,
I've found a minor bug in the mock_cloudformation.
**What goes wrong?**
When you create a change set with no changes, you get the wrong execution status, status and status reason
**How to repro... | getmoto/moto | 78339b97dc911c8c6841184eaddbbc30d0e406da | 1.4 | [
"tests/test_iam/test_iam_policies.py::test_create_policy_with_valid_policy_document[valid_policy_document47]",
"tests/test_iam/test_iam_policies.py::test_create_policy_with_invalid_policy_document[invalid_policy_document45]",
"tests/test_iam/test_iam_policies.py::test_create_policy_with_invalid_policy_document[... | [
"tests/test_s3/test_server.py::test_s3_server_post_without_content_length"
] |
getmoto__moto-5582 | Hi @JecaTatu, thanks for raising this! Looks like our delimiter is not quite working as it should, as it matches every key that contains the delimiter.
Looking at the docs it should only match keys that `contain the same string between the prefix and the first occurrence of the delimiter`. Marking this as a bug. :+1:... | diff --git a/moto/cognitoidp/models.py b/moto/cognitoidp/models.py
--- a/moto/cognitoidp/models.py
+++ b/moto/cognitoidp/models.py
@@ -579,6 +579,8 @@ def create_access_token(self, client_id, username):
return access_token, expires_in
def create_tokens_from_refresh_token(self, refresh_token):
+ i... | diff --git a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
--- a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
+++ b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
@@ -978,3 +978,75 @@ def test_gsi_key_cannot_be_empty():
... | 2024-02-16 19:18:32 | 'Maybe you forgot to use "await"?' has wrong error code
```python
from typing import AsyncGenerator
async def f() -> AsyncGenerator[str, None]:
raise Exception("fooled you")
async def g() -> None:
async for y in f(): # type: ignore[attr-defined]
print(y)
```
```
% mypy ~/py/tmp/async... | python/mypy | 67cc05926b037243b71e857a394318c3a09d1daf | 3.1 | [
"tests/test_sns/test_publishing_boto3.py::test_filtering_exact_string_message_body",
"tests/test_sns/test_publishing_boto3.py::test_filtering_attribute_key_exists_no_match",
"tests/test_sns/test_publishing_boto3.py::test_filtering_attribute_key_exists_match",
"tests/test_sns/test_subscriptions_boto3.py::test_... | [
"tests/test_kms/test_kms_grants.py::test_list_retirable_grants",
"tests/test_kms/test_kms_grants.py::test_list_grants",
"tests/test_kms/test_kms_grants.py::test_create_grant",
"tests/test_kms/test_kms_grants.py::test_retire_grant_by_grant_id",
"tests/test_kms/test_kms_grants.py::test_revoke_grant_by_token",... |
getmoto__moto-6470 | Thanks for raising this @pejter - marking it as an enhancement to implement this integration | diff --git a/moto/s3/models.py b/moto/s3/models.py
--- a/moto/s3/models.py
+++ b/moto/s3/models.py
@@ -2535,7 +2535,6 @@ def select_object_content(
key_name: str,
select_query: str,
input_details: Dict[str, Any],
- output_details: Dict[str, Any], # pylint: disable=unused-argument
... | diff --git a/tests/test_neptune/test_clusters.py b/tests/test_neptune/test_clusters.py
--- a/tests/test_neptune/test_clusters.py
+++ b/tests/test_neptune/test_clusters.py
@@ -64,7 +64,9 @@ def test_describe_db_clusters():
client.create_db_cluster(DBClusterIdentifier="cluster-id", Engine="neptune")
- cluster... | 2022-08-14 11:51:34 | Overriding definition such as type alias in a subclass causes a crash
The following program crashes on both mypy 0.620 and the latest version on master:
```python
from typing import Any, Callable
class Parent:
foo = Callable[..., int]
class Child(Parent):
def foo(self, val: int) -> int:
re... | python/mypy | e1c03ab0f37495ef4072892778ab126d04860814 | 3.1 | [] | [
"tests/test_dynamodb/test_dynamodb_expression_tokenizer.py::test_expression_tokenizer_single_set_action_attribute_name_leading_underscore"
] |
getmoto__moto-6998 | diff --git a/mypy/build.py b/mypy/build.py
--- a/mypy/build.py
+++ b/mypy/build.py
@@ -2546,7 +2546,8 @@ def module_not_found(manager: BuildManager, line: int, caller_state: State,
blocker=True)
errors.raise_error()
else:
- msg, notes = reason.error_message_templates()
+ ... | diff --git a/tests/test_cognitoidp/test_cognitoidp.py b/tests/test_cognitoidp/test_cognitoidp.py
--- a/tests/test_cognitoidp/test_cognitoidp.py
+++ b/tests/test_cognitoidp/test_cognitoidp.py
@@ -3212,6 +3212,12 @@ def test_global_sign_out():
err["Code"].should.equal("NotAuthorizedException")
err["Message"].sh... | 2024-02-09 23:36:56 | Autoscaling with missing availabilityZones and launchTemplate results in broken dashboard
## Reporting Bugs
fresh install of moto, run via `moto_server`
terraform json fragments (generated)
```
"aws_autoscaling_group": {
"ec2_auto_16C147B8": {
"//": {
"metadata": {
"pa... | getmoto/moto | 9c54cc3f1c73150992345350be834f2987b3967d | 0.940 | [
"tests/test_s3/test_s3_multipart.py::test_multipart_upload_should_return_part_10000",
"tests/test_s3/test_s3_multipart.py::test_complete_multipart_with_empty_partlist",
"tests/test_s3/test_s3_multipart.py::test_multipart_list_parts",
"tests/test_s3/test_s3_multipart.py::test_multipart_version",
"tests/test_... | [
"tests/test_ses/test_ses_boto3.py::test_identities_are_region_specific"
] | |
python__mypy-9380 | Linking https://github.com/python/mypy/issues/8754 which is not the same but also has issues related to re-exports and is another discrepancy between mypy and Pyright.
Thanks for flagging this, I'd be in favour of changing mypy's behaviour here.
Should be backward compatible in that we're allowing strictly more code.
... | diff --git a/moto/ec2/exceptions.py b/moto/ec2/exceptions.py
--- a/moto/ec2/exceptions.py
+++ b/moto/ec2/exceptions.py
@@ -461,6 +461,13 @@ def __init__(self, parameter_value):
)
+class EmptyTagSpecError(EC2ClientError):
+ def __init__(self):
+ super().__init__(
+ "InvalidParameterValu... | diff --git a/test-data/unit/check-generic-subtyping.test b/test-data/unit/check-generic-subtyping.test
--- a/test-data/unit/check-generic-subtyping.test
+++ b/test-data/unit/check-generic-subtyping.test
@@ -817,4 +817,28 @@ class Y(Generic[T]):
def f(self) -> T:
return U() # E: Incompatible return value ... | 2022-05-14 03:04:42 | S3: put_bucket_logging fails when the target prefix appears in the bucket policy
[This commit](https://github.com/douglasnaphas/moto/commit/7dcd7ea98a74948140b1f6ae221bc9071504408d) on my fork of moto shows the problem. The commit message explains it:
> https://github.com/getmoto/moto/pull/6715 enabled the use of pu... | getmoto/moto | e3fc799b95b223bbdf3713958807d1b77a5958f4 | 4.2 | [
"tests/test_ec2/test_instances.py::test_modify_instance_attribute_security_groups_boto3",
"tests/test_ec2/test_instances.py::test_run_instance_with_security_group_id_boto3",
"tests/test_ec2/test_instances.py::test_get_instances_filtering_by_state_boto3",
"tests/test_ec2/test_instances.py::test_modify_delete_o... | [
"tests/test_sns/test_application_boto3.py::test_get_list_endpoints_by_platform_application"
] |
getmoto__moto-6312 | Hi @DrGFreeman, thanks for raising this. We identified the same problem in `scan()`, and that was fixed in #7085, so hopefully we can reuse the solution for `query()`. | diff --git a/moto/logs/models.py b/moto/logs/models.py
--- a/moto/logs/models.py
+++ b/moto/logs/models.py
@@ -1,5 +1,5 @@
from datetime import datetime, timedelta
-from typing import Any, Dict, List, Tuple, Optional
+from typing import Any, Dict, Iterable, List, Tuple, Optional
from moto.core import BaseBackend, Bac... | diff --git a/tests/test_ecr/test_ecr_boto3.py b/tests/test_ecr/test_ecr_boto3.py
--- a/tests/test_ecr/test_ecr_boto3.py
+++ b/tests/test_ecr/test_ecr_boto3.py
@@ -1249,6 +1249,40 @@ def test_batch_delete_image_with_mismatched_digest_and_tag():
)
+@mock_ecr
+def test_delete_batch_image_with_multiple_images():
+... | 2021-06-21T14:22:54Z | stubgen: wrong import statements for base module when importing submodule
There's a bug with the import statements generated in .pyi files.
Consider the folder structure:
```
somefolder/
test.py
foo_mod/
__init__.py
bar_mod.py
```
with file contents:
```python
# test.py
import foo_... | getmoto/moto | 8642b351cff94c471333256f9cd6867807384f01 | 0.940 | [] | [
"tests/test_rds/test_rds.py::test_create_database",
"tests/test_rds/test_rds.py::test_get_databases"
] |
python__mypy-11810 | diff --git a/moto/dynamodb/models/table.py b/moto/dynamodb/models/table.py
--- a/moto/dynamodb/models/table.py
+++ b/moto/dynamodb/models/table.py
@@ -848,9 +848,9 @@ def scan(
passes_all_conditions = True
for attribute_name in filters:
attribute = item.attrs.get(attribute_nam... | diff --git a/tests/test_cloudfront/test_cloudfront.py b/tests/test_cloudfront/test_cloudfront.py
--- a/tests/test_cloudfront/test_cloudfront.py
+++ b/tests/test_cloudfront/test_cloudfront.py
@@ -223,3 +223,27 @@ def test_update_distribution_dist_config_not_set():
assert typename == "ParamValidationError"
erro... | 2022-05-11T13:19:30Z | @mock_cloudtrail is not being able to retrieve the trail status in a different region for a multiregion trail
## Description
As per the AWS Boto3 documentation, the [get_trail_status](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudtrail/client/get_trail_status.html) call is able to g... | getmoto/moto | cd35d486e7fdea0addea086b57ac2679c8d71544 | 0.940 | [] | [
"mypy/test/testcheck.py::TypeCheckSuite::testTypedDictAsStarStarAndDictAsStarStar",
"mypy/test/testcheck.py::TypeCheckSuite::testPassingMultipleKeywordVarArgs"
] | |
getmoto__moto-6308 | Thanks for raising this @nicolaei! Marking it as a bug. | diff --git a/moto/dynamodb/models/__init__.py b/moto/dynamodb/models/__init__.py
--- a/moto/dynamodb/models/__init__.py
+++ b/moto/dynamodb/models/__init__.py
@@ -1422,7 +1422,7 @@ def get_schema(self, table_name, index_name):
else:
return table.schema
- def get_table(self, table_name):
+ ... | diff --git a/tests/test_ecs/test_ecs_boto3.py b/tests/test_ecs/test_ecs_boto3.py
--- a/tests/test_ecs/test_ecs_boto3.py
+++ b/tests/test_ecs/test_ecs_boto3.py
@@ -115,7 +115,16 @@ def test_list_clusters():
def test_create_cluster_with_tags():
client = boto3.client("ecs", region_name="us-east-1")
tag_list = [... | 2022-09-01 22:42:31 | describe_instances fails to find instances when filtering by tag value contains square brackets (json encoded)
## Problem
Using boto3 ```describe_instances``` with filtering by tag key/value where the value cotnains a json encoded string (containing square brackets), the returned instances list is empty. This works wi... | python/mypy | ecd7cf9d921a4a793609ce243e875c7c1466e654 | 3.0 | [
"tests/test_ec2/test_elastic_ip_addresses.py::test_eip_disassociate_bogus_association",
"tests/test_ec2/test_elastic_ip_addresses.py::test_describe_addresses_tags",
"tests/test_ec2/test_elastic_ip_addresses.py::test_eip_reassociate_nic",
"tests/test_ec2/test_elastic_ip_addresses.py::test_eip_describe_none",
... | [
"tests/test_cognitoidp/test_cognitoidp.py::test_global_sign_out"
] |
getmoto__moto-6884 | Oops, I was supposed to raise this as crash
To be clear, this snippet only causes mypy to crash if the `--disallow-any-expr` option is enabled. If the option is not enabled, everything's fine.
Yes, but who in their right mind would ever not have that enabled. Also it's enabled by default in basedmypy.
It's a legitimat... | diff --git a/moto/ec2/models/spot_requests.py b/moto/ec2/models/spot_requests.py
--- a/moto/ec2/models/spot_requests.py
+++ b/moto/ec2/models/spot_requests.py
@@ -466,8 +466,10 @@ def cancel_spot_fleet_requests(self, spot_fleet_request_ids, terminate_instances
if terminate_instances:
spot_... | diff --git a/test-data/unit/check-async-await.test b/test-data/unit/check-async-await.test
--- a/test-data/unit/check-async-await.test
+++ b/test-data/unit/check-async-await.test
@@ -758,3 +758,44 @@ class Foo(Generic[T]):
[builtins fixtures/async_await.pyi]
[typing fixtures/typing-async.pyi]
+
+[case testAwaitOver... | 2023-03-09 23:44:27 | CloudWatchLog's put_subscription_filter() does not accept kinesis data stream destination
How to reproduce: Write a test which puts a subscription filter to a cloudwatch loggroup, mocking the loggroup name, the kinesis data stream, and the role arn. When the test calls the boto3 method put_subscription_filter(), the f... | getmoto/moto | b4f59b771cc8a89976cbea8c889758c132d405d0 | 4.2 | [
"tests/test_core/test_decorator_calls.py::TestWithNestedClasses::TestWithSetup::test_should_not_find_bucket_from_test_method",
"tests/test_core/test_decorator_calls.py::TestSetUpInBaseClass::test_a_thing",
"tests/test_core/test_decorator_calls.py::TestWithInvalidSetupMethod::test_should_not_find_bucket",
"tes... | [
"mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfSysVersion",
"mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfSkipUnknownExecution",
"mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfMerging",
"mypy/test/testcheck.py::Ty... |
getmoto__moto-5587 | diff --git a/mypy/semanal.py b/mypy/semanal.py
--- a/mypy/semanal.py
+++ b/mypy/semanal.py
@@ -2247,6 +2247,12 @@ def is_type_ref(self, rv: Expression, bare: bool = False) -> bool:
return True
# Assignment color = Color['RED'] defines a variable, not an alias.
return not rv.no... | diff --git a/test-data/unit/check-classes.test b/test-data/unit/check-classes.test
--- a/test-data/unit/check-classes.test
+++ b/test-data/unit/check-classes.test
@@ -7134,3 +7134,112 @@ class B(A): # E: Final class __main__.B has abstract attributes "foo"
[case testUndefinedBaseclassInNestedClass]
class C:
cla... | 2023-07-23 21:34:42 | EnabledCloudwatchLogsExports Rds Functionality Gap
Mocking the RDS inputs for `EnabledCloudwatchLogsExports` does nothing because support for this is missing in
https://github.com/spulec/moto/blob/master/moto/rds/responses.py
Currently using the latest version of Moto (3.1.5.dev4)
| getmoto/moto | 6843eb4c86ee0abad140d02930af95050120a0ef | 0.920 | [
"tests/test_glue/test_datacatalog.py::test_delete_database",
"tests/test_glue/test_datacatalog.py::test_create_partition_already_exist",
"tests/test_glue/test_datacatalog.py::test_get_partitions_empty",
"tests/test_glue/test_datacatalog.py::test_create_database",
"tests/test_glue/test_datacatalog.py::test_b... | [
"mypy/test/testcheck.py::TypeCheckSuite::testTypeGuardOverload"
] | |
getmoto__moto-5849 | diff --git a/mypy/semanal.py b/mypy/semanal.py
--- a/mypy/semanal.py
+++ b/mypy/semanal.py
@@ -2871,7 +2871,7 @@ def analyze_name_lvalue(self,
outer = self.is_global_or_nonlocal(name)
if kind == MDEF and isinstance(self.type, TypeInfo) and self.type.is_enum:
# Special case: we need to be ... | diff --git a/test-data/unit/check-parameter-specification.test b/test-data/unit/check-parameter-specification.test
--- a/test-data/unit/check-parameter-specification.test
+++ b/test-data/unit/check-parameter-specification.test
@@ -378,3 +378,31 @@ class C(Generic[P, P2]):
def m4(self, x: int) -> None:
pas... | 2022-03-19 23:52:50 | create_capacity_provider for ECS
Hi there. I was just wondering if you'll be adding support for `create_capacity_provider`?
Thank you.
| getmoto/moto | dda6e573dde5440612c3bab17247a4544c680b23 | 1.4 | [
"mypy/test/testcheck.py::TypeCheckSuite::testTypeVarWithTypedDictValueInIndexExpression",
"mypy/test/testcheck.py::TypeCheckSuite::testSelfTypeVarIndexExpr"
] | [
"tests/test_ec2/test_security_groups.py::test_create_and_describe_security_grp_rule"
] | |
getmoto__moto-6868 | Thanks for raising this @CrypticCabub! Marking it as a bug. | diff --git a/moto/awslambda/exceptions.py b/moto/awslambda/exceptions.py
--- a/moto/awslambda/exceptions.py
+++ b/moto/awslambda/exceptions.py
@@ -1,4 +1,5 @@
from moto.core.exceptions import JsonRESTError
+from typing import Any
class LambdaClientError(JsonRESTError):
@@ -63,6 +64,16 @@ def __init__(self) -> Non... | diff --git a/tests/test_ec2/test_instances.py b/tests/test_ec2/test_instances.py
--- a/tests/test_ec2/test_instances.py
+++ b/tests/test_ec2/test_instances.py
@@ -1,5 +1,6 @@
import base64
import ipaddress
+import json
import warnings
from unittest import SkipTest, mock
from uuid import uuid4
@@ -769,9 +770,15 @@ ... | 2022-07-30 20:28:14 | Secrets Manager backend does not support partial ARNs
The `moto` secrets manager backend is unable to retrieve secrets when a partial ARN is passed as secret ID.
**How to reproduce the issue**
Here is a minimal example that demonstrates the issue:
```python
import boto3
import pytest
from moto import mock_secre... | getmoto/moto | 5b2da11e19bee695a8860c1b614f1cf4295206e5 | 4.2 | [
"mypy/test/testcheck.py::TypeCheckSuite::check-dataclasses.test::testDataclassOrderingWithoutEquality",
"mypy/test/testcheck.py::TypeCheckSuite::check-dataclasses.test::testDataclassOrdering",
"mypy/test/testcheck.py::TypeCheckSuite::check-dataclasses.test::testDataclassOrderingDeferred",
"mypy/test/testcheck... | [
"tests/test_batch/test_batch_jobs.py::test_submit_job_with_timeout_set_at_definition",
"tests/test_batch/test_batch_jobs.py::test_submit_job_with_timeout",
"tests/test_batch/test_batch_jobs.py::test_register_job_definition_with_timeout",
"tests/test_batch/test_batch_jobs.py::test_cancel_job_empty_argument_str... |
getmoto__moto-4849 | diff --git a/moto/events/models.py b/moto/events/models.py
--- a/moto/events/models.py
+++ b/moto/events/models.py
@@ -966,6 +966,24 @@ def parse(self) -> Dict[str, Any]:
raise InvalidEventPatternException(reason="Invalid JSON")
+class PartnerEventSource(BaseModel):
+ def __init__(self, region: str,... | diff --git a/test-data/unit/check-typeddict.test b/test-data/unit/check-typeddict.test
--- a/test-data/unit/check-typeddict.test
+++ b/test-data/unit/check-typeddict.test
@@ -221,6 +221,17 @@ reveal_type(d) # N: Revealed type is "TypedDict('__main__.D', {'y': builtins.in
[builtins fixtures/dict.pyi]
[typing fixtures... | 2024-03-29 11:49:37 | Defining _order_ in an enum class rejected
This generates an error, even though it's valid:
```py
from enum import Enum
class E(Enum):
_order_ = 'X Y' # Cannot override writable attribute "_order_" with a final one
X = 1
Y = 2
```
According to the [docs](https://docs.python.org/3/library/enum... | getmoto/moto | a853fd714d133c9a9ca0479cb99537d9a39d85bf | 0.960 | [
"mypy/test/testpythoneval.py::PythonEvaluationSuite::testTypingOrderedDictAlias"
] | [
"tests/test_resiliencehub/test_resiliencehub.py::test_describe_unknown_app",
"tests/test_resiliencehub/test_resiliencehub.py::test_create_resilience_policy_with_unknown_policy_type",
"tests/test_resiliencehub/test_resiliencehub.py::test_list_resiliency_policies",
"tests/test_resiliencehub/test_resiliencyhub_t... | |
getmoto__moto-6641 | Thanks for the report! I think this bisects to https://github.com/python/mypy/pull/14178 | diff --git a/moto/rds/models.py b/moto/rds/models.py
--- a/moto/rds/models.py
+++ b/moto/rds/models.py
@@ -54,7 +54,7 @@ def __init__(self, **kwargs):
self.account_id = kwargs.get("account_id")
self.region_name = kwargs.get("region")
self.cluster_create_time = iso_8601_datetime_with_milliseco... | diff --git a/tests/test_s3/test_s3_copyobject.py b/tests/test_s3/test_s3_copyobject.py
--- a/tests/test_s3/test_s3_copyobject.py
+++ b/tests/test_s3/test_s3_copyobject.py
@@ -783,6 +783,58 @@ def test_copy_object_in_place_with_bucket_encryption():
assert response["ServerSideEncryption"] == "AES256"
+@mock_aws
... | 2021-11-21T09:41:09Z | `IoTDataPlaneResponse.publish` fails to correctly pass payload to `IotDataPlaneBackend.publish` method
Hi,
When trying to implement a unit test that validates that MQTT message was sent via `boto3.client('iot-data')` client to specific topic, I found out that `IoTDataPlaneResponse.publish` fails to pass down `payloa... | getmoto/moto | 00f3913b314994b4b391a2813a839c094482b632 | 3.1 | [
"tests/test_ssm/test_ssm_boto3.py::test_get_parameters_should_only_return_unique_requests",
"tests/test_ssm/test_ssm_boto3.py::test_describe_parameters_attributes",
"tests/test_ssm/test_ssm_boto3.py::test_describe_parameters_invalid_parameter_filters[filters6-The",
"tests/test_ssm/test_ssm_boto3.py::test_desc... | [
"tests/test_timestreamwrite/test_timestreamwrite_table.py::test_write_records"
] |
getmoto__moto-5576 | Hi @nonchan7720, thanks for raising this. I've identified the following operations where this problem could occur:
- "AWSCognitoIdentityProviderService.ConfirmSignUp"
- "AWSCognitoIdentityProviderService.GetUser"
- "AWSCognitoIdentityProviderService.ForgotPassword"
- "AWSCognitoIdentityProviderService.InitiateAut... | diff --git a/moto/cognitoidp/models.py b/moto/cognitoidp/models.py
--- a/moto/cognitoidp/models.py
+++ b/moto/cognitoidp/models.py
@@ -568,6 +568,9 @@ def add_custom_attributes(self, custom_attributes: List[Dict[str, str]]) -> None
def create_id_token(self, client_id: str, username: str) -> Tuple[str, int]:
... | diff --git a/test-data/unit/check-flags.test b/test-data/unit/check-flags.test
--- a/test-data/unit/check-flags.test
+++ b/test-data/unit/check-flags.test
@@ -1562,17 +1562,7 @@ __all__ = ('b',)
[out]
main:2: error: Module "other_module_2" does not explicitly export attribute "a"; implicit reexport disabled
-[case ... | 2022-04-11 19:00:42 | disallow_untyped_calls in module does not override global section
**Bug Report**
Since updating numpy from version "1.20.3" to version "1.21.0" we are getting the following errors:
`error: Call to untyped function "load" in typed context`
We want to suppress errors about untyped calls from numpy - but not glob... | getmoto/moto | 7e2cd923200fc0942158772dd212b9746c7f8fd7 | 4.2 | [
"mypy/test/testcheck.py::TypeCheckSuite::check-narrowing.test::testNarrowingLiteralIdentityCheck"
] | [
"mypy/test/testcheck.py::TypeCheckSuite::check-typevar-tuple.test::testVariadicAliasMultipleUnpacks",
"mypy/test/testcheck.py::TypeCheckSuite::check-typevar-tuple.test::testVariadicAliasRecursiveUnpack",
"mypy/test/testcheck.py::TypeCheckSuite::check-typevar-tuple.test::testVariadicAliasUnpackFixedTupleTarget",... |
python__mypy-11962 | Thanks for raising this @Frogvall! Marking it as an enhancement to validate whether there are any changes, before applying | diff --git a/moto/scheduler/exceptions.py b/moto/scheduler/exceptions.py
--- a/moto/scheduler/exceptions.py
+++ b/moto/scheduler/exceptions.py
@@ -2,6 +2,11 @@
from moto.core.exceptions import JsonRESTError
+class ScheduleExists(JsonRESTError):
+ def __init__(self, name: str) -> None:
+ super().__init__(... | diff --git a/tests/test_ecr/test_ecr_boto3.py b/tests/test_ecr/test_ecr_boto3.py
--- a/tests/test_ecr/test_ecr_boto3.py
+++ b/tests/test_ecr/test_ecr_boto3.py
@@ -581,6 +581,55 @@ def test_put_same_image_with_same_tag():
images.should.have.length_of(1)
+@mock_ecr
+def test_multiple_tags__ensure_tags_exist_only... | 2022-04-24 14:28:18 | Variable `typing_extensions.OrderedDict` is not valid as a type
```py
from typing_extensions import OrderedDict
a: OrderedDict[str, str] = {} # error: Variable "typing_extensions.OrderedDict" is not valid as a type
class A(OrderedDict[str, str]): # error: Invalid base class "OrderedDict"
...
```
mypy 0... | getmoto/moto | fc2e21b8ff37837c38781048b936486c4fe3243f | 1.4 | [
"mypy/test/testfinegrainedcache.py::FineGrainedCacheSuite::testTwoRounds_cached",
"mypy/test/testfinegrained.py::FineGrainedSuite::testRemoveBaseClass",
"mypy/test/testfinegrained.py::FineGrainedSuite::testFollowImportsNormalDuringStartup3",
"mypy/test/testcheck.py::TypeCheckSuite::testSerializeFromImportedCl... | [
"tests/test_core/test_moto_api.py::test_overwriting_s3_object_still_returns_data"
] |
getmoto__moto-4833 | Thanks for raising this @stof, and welcome to Moto! Marking it as an enhancement to add this field.
It doesn't look like this field is returned anywhere else, in GetHostedZone or ListHostedZones, so we'll just add it to the Create-operation.
I confirm that the description files used by the official AWS SDKs have thi... | diff --git a/moto/iot/responses.py b/moto/iot/responses.py
--- a/moto/iot/responses.py
+++ b/moto/iot/responses.py
@@ -581,14 +581,14 @@ def list_thing_principals(self) -> str:
return json.dumps(dict(principals=principals))
def describe_thing_group(self) -> str:
- thing_group_name = self._get_par... | diff --git a/tests/test_route53/test_route53.py b/tests/test_route53/test_route53.py
--- a/tests/test_route53/test_route53.py
+++ b/tests/test_route53/test_route53.py
@@ -22,7 +22,11 @@ def test_create_hosted_zone_boto3():
firstzone.should.have.key("ResourceRecordSetCount").equal(0)
delegation = response["D... | 2023-03-23 11:36:20 | Strict equality false positive when strict optional disabled
This generates an unexpected error:
```py
# mypy: no-strict-optional, strict-equality
from typing import Any, Optional
x: Optional[Any]
if x in (1, 2): # Error: non-overlapping container check
pass
```
With strict optional checking enab... | getmoto/moto | 90e63c1cb5178acaa49cfc301b2688dcaba12115 | 4.1 | [
"tests/test_secretsmanager/test_secretsmanager.py::test_get_secret_that_has_no_value",
"tests/test_secretsmanager/test_secretsmanager.py::test_get_secret_value_by_arn",
"tests/test_secretsmanager/test_secretsmanager.py::test_update_secret_with_KmsKeyId",
"tests/test_secretsmanager/test_secretsmanager.py::test... | [
"tests/test_ec2/test_instances.py::test_create_instance_with_default_options"
] |
python__mypy-11317 | I think this can be done using literal types: essentially we can treat `bool` as `Union[Literal[True], Literal[False]]`.
cc @Michael0x2a
This appeared again so raising priority to normal.
Would like to take a stab at this if no one's picked it up already!
| diff --git a/mypy/semanal.py b/mypy/semanal.py
--- a/mypy/semanal.py
+++ b/mypy/semanal.py
@@ -76,7 +76,8 @@
get_nongen_builtins, get_member_expr_fullname, REVEAL_TYPE,
REVEAL_LOCALS, is_final_node, TypedDictExpr, type_aliases_source_versions,
EnumCallExpr, RUNTIME_PROTOCOL_DECOS, FakeExpression, Stateme... | diff --git a/tests/test_s3/test_server.py b/tests/test_s3/test_server.py
--- a/tests/test_s3/test_server.py
+++ b/tests/test_s3/test_server.py
@@ -254,10 +254,11 @@ def test_s3_server_post_cors_exposed_header():
"""
test_client = authenticated_client()
+ valid_origin = "https://example.org"
prefligh... | 2022-05-10 21:35:11 | TypedDict does not allow .get("missing_key", ...) to pass
**Bug Report**
MyPy does not allow `.get("key")` on a TypedDict if the key does not exist. This nullifies the usefulness of `.get`, and seems to be in direct contradiction to PEP 589:
"Operations with arbitrary str keys (instead of string literals or other... | python/mypy | d28c4bfb9390e04b9dadf95d778999c0c493a50a | 4.2 | [
"tests/test_glue/test_datacatalog.py::test_delete_database",
"tests/test_glue/test_datacatalog.py::test_create_partition_already_exist",
"tests/test_glue/test_datacatalog.py::test_get_partitions_empty",
"tests/test_glue/test_datacatalog.py::test_create_database",
"tests/test_glue/test_datacatalog.py::test_b... | [
"tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_query_with_missing_expression_attribute"
] |
getmoto__moto-7177 | diff --git a/mypy/plugins/default.py b/mypy/plugins/default.py
--- a/mypy/plugins/default.py
+++ b/mypy/plugins/default.py
@@ -237,8 +237,7 @@ def typed_dict_get_callback(ctx: MethodContext) -> Type:
for key in keys:
value_type = get_proper_type(ctx.type.items.get(key))
if value_type ... | diff --git a/tests/test_cognitoidp/test_cognitoidp_exceptions.py b/tests/test_cognitoidp/test_cognitoidp_exceptions.py
new file mode 100644
--- /dev/null
+++ b/tests/test_cognitoidp/test_cognitoidp_exceptions.py
@@ -0,0 +1,48 @@
+from unittest import TestCase
+
+import boto3
+from moto import mock_cognitoidp
+from boto... | 2022-09-30 18:57:18 | cognito-idp can't find users pool by client id
My AWS profile is configured to work with `us-west-2`
~/.aws/config
```
[default]
region = us-west-2
output = json
```
I created new `test-pool` user pool.
```sh
aws --endpoint-url=http://127.0.0.1:5000 \
cognito-idp create-user-pool \
--pool-name... | getmoto/moto | de714eb4cc2ebf4065eba8cc886c4eb6649b061b | 4.0 | [] | [
"tests/test_resourcegroupstaggingapi/test_resourcegroupstaggingapi.py::test_get_resources_rds_clusters"
] | |
getmoto__moto-5155 | diff --git a/moto/athena/models.py b/moto/athena/models.py
--- a/moto/athena/models.py
+++ b/moto/athena/models.py
@@ -42,7 +42,7 @@ def __init__(
self,
athena_backend: "AthenaBackend",
name: str,
- configuration: str,
+ configuration: Dict[str, Any],
description: str,
... | diff --git a/tests/test_sns/test_publish_batch.py b/tests/test_sns/test_publish_batch.py
--- a/tests/test_sns/test_publish_batch.py
+++ b/tests/test_sns/test_publish_batch.py
@@ -100,7 +100,7 @@ def test_publish_batch_standard_with_message_group_id():
{
"Id": "id_2",
"Code": "InvalidP... | 2023-03-24 23:01:32 | @overload cannot be used with conditional "if TYPE_CHECKING"
**Bug Report**
The handling of `@overload` decorators happens in (code) blocks only, which makes it not find the implementation when using:
```python
from typing import overload
from typing import TYPE_CHECKING
from typing import Union
class K:
... | getmoto/moto | 40d04a5af0b658ae5ef6181c7f3d89a984fe3547 | 4.0 | [
"tests/test_athena/test_athena.py::test_create_and_get_workgroup",
"tests/test_athena/test_athena.py::test_create_work_group",
"tests/test_athena/test_athena.py::test_stop_query_execution",
"tests/test_athena/test_athena.py::test_get_named_query",
"tests/test_athena/test_athena.py::test_list_query_execution... | [
"tests/test_s3/test_server.py::test_s3_server_bucket_create[baz"
] | |
getmoto__moto-5200 | diff --git a/moto/sagemakerruntime/models.py b/moto/sagemakerruntime/models.py
--- a/moto/sagemakerruntime/models.py
+++ b/moto/sagemakerruntime/models.py
@@ -1,6 +1,8 @@
+import json
from typing import Dict, List, Tuple
from moto.core import BackendDict, BaseBackend
+from moto.moto_api._internal import mock_random... | diff --git a/tests/test_awslambda/test_lambda.py b/tests/test_awslambda/test_lambda.py
--- a/tests/test_awslambda/test_lambda.py
+++ b/tests/test_awslambda/test_lambda.py
@@ -213,6 +213,37 @@ def test_create_function__with_tracingmode(tracing_mode):
result.should.have.key("TracingConfig").should.equal({"Mode": out... | 2022-02-25T16:44:42Z | Better support for default arguments to new-style attrs API
**Bug Report**
attrs.define has `slots=True` by default. Mypy does not use the default value when analysing
**To Reproduce**
```python
# demo.py
import attr
@attr.define
class A:
x: int
def __init__(self, x :int) -> None:
self.x = ... | python/mypy | 62647ab1a3adc6d6a18bed106999fac5183d432d | 4.2 | [
"mypy/test/testcheck.py::TypeCheckSuite::check-flags.test::testPerModuleErrorCodes",
"mypy/test/testcheck.py::TypeCheckSuite::check-flags.test::testPerModuleErrorCodesOverride"
] | [
"tests/test_iotdata/test_iotdata.py::test_publish"
] | |
getmoto__moto-6885 | And looks like `CreateSecret` has the same issue. I don't know why you will need to create a secret without a value, but in AWS you can, and the result is secret without any version, where Moto creates version with no value.
Thanks for raising this @matshch, and welcome to Moto! | diff --git a/moto/cognitoidp/models.py b/moto/cognitoidp/models.py
--- a/moto/cognitoidp/models.py
+++ b/moto/cognitoidp/models.py
@@ -1403,10 +1403,13 @@ def create_resource_server(self, user_pool_id, identifier, name, scopes):
return resource_server
def sign_up(self, client_id, username, password, att... | diff --git a/test-data/unit/check-typeguard.test b/test-data/unit/check-typeguard.test
--- a/test-data/unit/check-typeguard.test
+++ b/test-data/unit/check-typeguard.test
@@ -458,3 +458,92 @@ def foobar_typeguard(x: object):
return
reveal_type(x) # N: Revealed type is "__main__.<subclass of "Foo" and "Ba... | 2023-10-15 19:15:25 | Pass kwargs to create_multipart_upload
Hi 👋
We have some kwargs going into [`create_multipart_upload`](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.create_multipart_upload) (using `smart_open` [under the hood](https://github.com/ddelange/pypicloud/blob/cb97fcb6a3f31c... | getmoto/moto | 90850bc57314b2c7fa62b4917577b1a24a528f25 | 0.810 | [
"tests/test_cloudfront/test_cloudfront_distributions.py::test_get_distribution_config",
"tests/test_cloudfront/test_cloudfront_distributions.py::test_create_distribution_returns_etag",
"tests/test_cloudfront/test_cloudfront_distributions.py::test_create_distribution_with_additional_fields[aliases0-True-False-Fa... | [
"tests/test_ssm/test_ssm_boto3.py::test_describe_parameters_tags"
] |
getmoto__moto-6022 | diff --git a/moto/dynamodb/models/table.py b/moto/dynamodb/models/table.py
--- a/moto/dynamodb/models/table.py
+++ b/moto/dynamodb/models/table.py
@@ -692,7 +692,11 @@ def query(
key for key in index.schema if key["KeyType"] == "RANGE"
][0]
except IndexError:
- ... | diff --git a/test-data/unit/check-incremental.test b/test-data/unit/check-incremental.test
--- a/test-data/unit/check-incremental.test
+++ b/test-data/unit/check-incremental.test
@@ -3015,7 +3015,7 @@ class NoInit:
class NoCmp:
x: int
-[builtins fixtures/list.pyi]
+[builtins fixtures/plugin_attrs.pyi]
[recheck... | 2024-01-30 19:56:07 | Request AWS::EMR::Cluster resource to be added to cloudformation
Request for AWS::EMR::Cluster to be added to cloudformation. This is used for our testing and we would like to request this resource to be added.
| getmoto/moto | 3545d38595e91a94a38d88661cd314172cb48bef | 4.0 | [
"tests/test_ecs/test_ecs_boto3.py::test_update_missing_service",
"tests/test_ecs/test_ecs_boto3.py::test_start_task_with_tags",
"tests/test_ecs/test_ecs_boto3.py::test_create_running_service_negative_env_var",
"tests/test_ecs/test_ecs_boto3.py::test_update_service",
"tests/test_ecs/test_ecs_boto3.py::test_l... | [
"mypy/test/testcheck.py::TypeCheckSuite::check-flags.test::testNoImplicitReexportStarConsideredExplicit"
] | |
getmoto__moto-6299 | Thanks for raising this @vittoema96! Marking it as a bug. | diff --git a/moto/core/responses.py b/moto/core/responses.py
--- a/moto/core/responses.py
+++ b/moto/core/responses.py
@@ -343,8 +343,6 @@ def setup_class(
if hasattr(self.body, "read"):
self.body = self.body.read()
- raw_body = self.body
-
# https://github.com/getmoto/moto/issue... | diff --git a/test-data/unit/check-python310.test b/test-data/unit/check-python310.test
--- a/test-data/unit/check-python310.test
+++ b/test-data/unit/check-python310.test
@@ -1372,7 +1372,7 @@ match m:
reveal_type(m) # N: Revealed type is "__main__.Medal"
[case testMatchNarrowUsingPatternGuardSpecialCase]
... | 2021-02-05T14:59:39Z | Make enum values final
#10852 made it so that boolean values are correctly identified as Literals in an enum. Other values seem to not be:
```python a.py
from enum import Enum
class Truth(Enum):
true = True
false = False
class MyInt(Enum):
a = 0
b = 1
class MyStr(Enum):
a = "a"
... | getmoto/moto | 4518b55663bc689646280a0ab2247c4a724bf3c0 | 4.0 | [
"tests/test_s3/test_s3_multipart.py::test_head_object_returns_part_count",
"tests/test_s3/test_s3_multipart.py::test_multipart_upload_should_return_part_10000",
"tests/test_s3/test_s3_multipart.py::test_complete_multipart_with_empty_partlist",
"tests/test_s3/test_s3_multipart.py::test_multipart_list_parts",
... | [
"mypy/test/testcheck.py::TypeCheckSuite::check-classes.test::testConstructorJoinsWithCustomMetaclass"
] |
python__mypy-11215 | diff --git a/moto/rds/exceptions.py b/moto/rds/exceptions.py
--- a/moto/rds/exceptions.py
+++ b/moto/rds/exceptions.py
@@ -82,6 +82,14 @@ def __init__(self, database_identifier: str):
)
+class DBClusterToBeDeletedHasActiveMembers(RDSClientError):
+ def __init__(self) -> None:
+ super().__init__(
... | diff --git a/tests/test_ec2/test_vpcs.py b/tests/test_ec2/test_vpcs.py
--- a/tests/test_ec2/test_vpcs.py
+++ b/tests/test_ec2/test_vpcs.py
@@ -6,7 +6,8 @@
import sure # noqa # pylint: disable=unused-import
import random
-from moto import mock_ec2
+from moto import mock_ec2, settings
+from unittest import SkipTest
... | 2022-10-04T10:32:50Z | VPC endpoint not created as part of cloudformation create stack
Hi,
I'm using the latest version of moto(3.0.5).
I have a simple cft template that creates GWLB vpc endpoint and subnet given service name, vpcId, az and CIDR block for the subnet. Everything works fine when deploying in AWS.
With the current mo... | getmoto/moto | 28d57b13ab5ea765728bde534eda2877f8d92b4b | 1.0 | [
"tests/test_organizations/test_organizations_boto3.py::test_describe_organization",
"tests/test_organizations/test_organizations_boto3.py::test_aiservices_opt_out_policy",
"tests/test_organizations/test_organizations_boto3.py::test_list_accounts_pagination",
"tests/test_organizations/test_organizations_boto3.... | [
"tests/test_ec2/test_instances.py::test_run_instance_with_placement"
] | |
python__mypy-12254 | Thanks for raising this @cheshirex :+1:
Hi @cheshirex, what version of Moto are you using?
Against the latest version, I am seeing the correct error message:
`The instance ID '['instance-1', 'i-34f0548abfb5d2a97', 'instance-2']' does not exist`
(Where `i-34f0548abfb5d2a97` is an existing instance ID)
(Sorry, I mi... | diff --git a/mypy/build.py b/mypy/build.py
--- a/mypy/build.py
+++ b/mypy/build.py
@@ -751,7 +751,6 @@ def correct_rel_imp(imp: Union[ImportFrom, ImportAll]) -> str:
res.append((ancestor_pri, ".".join(ancestors), imp.line))
elif isinstance(imp, ImportFrom):
... | diff --git a/tests/test_redshift/test_redshift.py b/tests/test_redshift/test_redshift.py
--- a/tests/test_redshift/test_redshift.py
+++ b/tests/test_redshift/test_redshift.py
@@ -219,6 +219,7 @@ def test_create_cluster_all_attributes():
assert cluster["ClusterVersion"] == "1.0"
assert cluster["AllowVersionUpg... | 2024-02-11 19:42:00 | EC2 run instances with --iam-instance-profile strange error
I encounter strange behavior with `aws ec2 run-instances` which includes `--iam-instance-profile` flag.
With simple
```
aws ec2 run-instances --image-id ami-example1234567890
```
it works fine, instance is created. I get 200 response in log:
```
192.1... | python/mypy | 1d7440914e4387661b0f200d16cd85298fd116e9 | 4.2 | [
"tests/test_core/test_auth.py::test_s3_access_denied_with_denying_attached_group_policy",
"tests/test_core/test_auth.py::test_allowed_with_wildcard_action",
"tests/test_core/test_auth.py::test_access_denied_for_run_instances",
"tests/test_core/test_auth.py::test_access_denied_with_no_policy",
"tests/test_co... | [
"tests/test_dynamodb/test_dynamodb.py::test_scan_with_scanfilter"
] |
getmoto__moto-5885 | Thanks, I will take a look today!
Same assertion is hit in https://github.com/python/mypy/issues/12252, #12113, #11728 and https://github.com/python/mypy/issues/10140
A smaller example from https://github.com/python/mypy/issues/10140#issuecomment-791289461 :
```
from typing import TypeVar
def test() -> None:
... | diff --git a/moto/ec2/exceptions.py b/moto/ec2/exceptions.py
--- a/moto/ec2/exceptions.py
+++ b/moto/ec2/exceptions.py
@@ -436,6 +436,14 @@ def __init__(self, parameter_value: str):
)
+class InvalidParameterValueErrorTagSpotFleetRequest(EC2ClientError):
+ def __init__(self, resource_type: str):
+ ... | diff --git a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
--- a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
+++ b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
@@ -933,12 +933,21 @@ def test_put_item__string_as_intege... | 2022-03-01T17:08:23Z | Cloudformation template (awslambda) throws unhashable type: 'dict'
The following
```
template = {
"Resources": {
"olivedrabpeachpuffMoto396419EF": {
"Type": "Custom::Whatever",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": [
"MyNestedStackMotoPr... | getmoto/moto | 6da12892a3c18248a2cfe55bc7d2cb3039817684 | 4.1 | [
"mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfNotMerging",
"mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfOldStyle",
"mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfNotMergingDifferentNames",
"mypy/test/testcheck.p... | [
"tests/test_batch/test_batch_jobs.py::test_submit_job_by_name"
] |
getmoto__moto-5614 | Thanks for raising this @kunalvudathu - marking it as an enhancement to add this filter. | diff --git a/moto/s3/models.py b/moto/s3/models.py
--- a/moto/s3/models.py
+++ b/moto/s3/models.py
@@ -242,7 +242,7 @@ def response_dict(self) -> Dict[str, Any]: # type: ignore[misc]
res["x-amz-server-side-encryption"] = self.encryption
if self.encryption == "aws:kms" and self.kms_key_id is n... | diff --git a/tests/test_awslambda/test_lambda_eventsourcemapping.py b/tests/test_awslambda/test_lambda_eventsourcemapping.py
--- a/tests/test_awslambda/test_lambda_eventsourcemapping.py
+++ b/tests/test_awslambda/test_lambda_eventsourcemapping.py
@@ -115,6 +115,7 @@ def test_invoke_function_from_dynamodb_put():
... | 2023-01-28 22:42:19 | mock_cloudformation with SNS fails to delete stack
Using the mock_cloudformation, creating a stack containing a single SNS topic, then deleting the stack fails with an invalid ARN
## Reproduction steps:
```python
def test_failure(cloudformation_mock):
cloudformation_mock.create_stack(
StackName="t... | getmoto/moto | 096a89266c05e123f98eef10ecf2638aa058e884 | 0.800 | [
"tests/test_ec2/test_instances.py::test_run_instance_with_block_device_mappings_missing_ebs",
"tests/test_ec2/test_instances.py::test_get_instances_filtering_by_tag",
"tests/test_ec2/test_instances.py::test_run_instance_and_associate_public_ip",
"tests/test_ec2/test_instances.py::test_modify_instance_attribut... | [
"tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_put_item_empty_set"
] |
getmoto__moto-6408 | I bisected this back to #14224 , which fixed a case where we were basically not type checking coroutines and generators. My guess is you'd need to make a similar change in https://github.com/python/mypy/blob/6b326d556e3a34949c363ef1f728abda164a9f24/mypy/checkexpr.py#L5079
By the way, did you happen to encounter this re... | diff --git a/mypy/checker.py b/mypy/checker.py
--- a/mypy/checker.py
+++ b/mypy/checker.py
@@ -5043,6 +5043,19 @@ def visit_continue_stmt(self, s: ContinueStmt) -> None:
return None
def visit_match_stmt(self, s: MatchStmt) -> None:
+ named_subject: Expression
+ if isinstance(s.subject, Cal... | diff --git a/tests/terraformtests/terraform-tests.success.txt b/tests/terraformtests/terraform-tests.success.txt
--- a/tests/terraformtests/terraform-tests.success.txt
+++ b/tests/terraformtests/terraform-tests.success.txt
@@ -109,6 +109,12 @@ iot:
- TestAccIoTEndpointDataSource
kms:
- TestAccKMSAlias
+ - TestA... | 2023-10-21T12:00:44Z | KeyError in _lookup_expression_attribute_value
Moto version: `4.2.8.dev`
The following command
```
aws --endpoint-url http://localhost:5000 dynamodb scan --table-name tsh-ip-bans scan --filter-expression "location1 = :loc" --expression-attribute-values '{"loc": {"S": "mgmt"}}'
```
Results in the following error:... | getmoto/moto | 4996d571272adde83a3de2689c0147ca1be23f2c | 4.1 | [
"tests/test_ecr/test_ecr_boto3.py::test_delete_repository_with_force",
"tests/test_ecr/test_ecr_boto3.py::test_start_image_scan_error_repo_not_exists",
"tests/test_ecr/test_ecr_boto3.py::test_get_lifecycle_policy",
"tests/test_ecr/test_ecr_boto3.py::test_create_repository_with_non_default_config",
"tests/te... | [
"mypy/test/testparse.py::ParserSuite::parse.test::testForAndTrailingCommaAfterIndexVars",
"mypy/test/testsemanal.py::SemAnalSuite::semanal-statements.test::testVariableInBlock",
"mypy/test/testparse.py::ParserSuite::parse.test::testTryFinally",
"mypy/test/testmerge.py::ASTMergeSuite::merge.test::testClass",
... |
getmoto__moto-5980 | diff --git a/mypy/stubgen.py b/mypy/stubgen.py
--- a/mypy/stubgen.py
+++ b/mypy/stubgen.py
@@ -100,6 +100,7 @@
OpExpr,
OverloadedFuncDef,
SetExpr,
+ StarExpr,
Statement,
StrExpr,
TempNode,
@@ -339,6 +340,9 @@ def visit_ellipsis(self, node: EllipsisExpr) -> str:
def visit_op_expr(se... | diff --git a/tests/test_sts/test_sts.py b/tests/test_sts/test_sts.py
--- a/tests/test_sts/test_sts.py
+++ b/tests/test_sts/test_sts.py
@@ -66,9 +66,12 @@ def test_get_federation_token_boto3():
@freeze_time("2012-01-01 12:00:00")
@mock_aws
-def test_assume_role():
- client = boto3.client("sts", region_name="us-ea... | 2023-09-08 21:11:12 | rds: `AvailabilityZone` is not printed out in `describe_db_instances`
Despite being taken as an argument for `create_db_instance` (and stored in the `Database` model), the `AvailabilityZone` (`DBInstance/AvailabilityZone`) is not printed out in the:
```python
rds.describe_db_instances(DBInstanceIdentifier='arn')
```... | getmoto/moto | 1eb3479d084836b851b498f022a335db21abf91a | 4.0 | [
"tests/test_ec2/test_tags.py::test_retrieved_snapshots_must_contain_their_tags",
"tests/test_ec2/test_tags.py::test_instance_create_tags",
"tests/test_ec2/test_tags.py::test_invalid_id",
"tests/test_ec2/test_tags.py::test_filter_instances_by_wildcard_tags",
"tests/test_ec2/test_tags.py::test_get_all_tags_re... | [
"tests/test_cloudfront/test_cloudfront_distributions.py::test_create_distribution_s3_minimum",
"tests/test_cloudfront/test_cloudfront_distributions.py::test_create_distribution_with_additional_fields"
] | |
getmoto__moto-6609 | Thanks for raising this @clowe-r7 - marking it as an enhancement to add this field | diff --git a/moto/s3/models.py b/moto/s3/models.py
--- a/moto/s3/models.py
+++ b/moto/s3/models.py
@@ -2235,7 +2235,7 @@ def put_bucket_accelerate_configuration(
raise InvalidRequest("PutBucketAccelerateConfiguration")
bucket.set_accelerate_configuration(accelerate_configuration)
- def put_bu... | diff --git a/tests/test_ecs/test_ecs_boto3.py b/tests/test_ecs/test_ecs_boto3.py
--- a/tests/test_ecs/test_ecs_boto3.py
+++ b/tests/test_ecs/test_ecs_boto3.py
@@ -2481,42 +2481,6 @@ def test_describe_tasks_empty_tags():
assert len(response["tasks"]) == 1
-@mock_ec2
-@mock_ecs
-def test_describe_tasks_include_t... | 2023-04-17 17:26:30 | `put_item` using `batch_writer` does not validate empty strings
Issue similar to #1129
When putting items with empty strings using `batch_writer` `ClientError` is not raised.
Using `moto==3.1.16`
Failing test case:
```python
import pytest
import boto3
import botocore
from moto import mock_dynamodb
@pyt... | getmoto/moto | da7268c3af04686f70905750c5d58144f6e6d049 | 4.2 | [
"tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_describe_stack_with_special_chars",
"tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_get_template_summary",
"tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_create_change_set_from_s3_url",
... | [
"tests/test_dynamodb/test_dynamodb_batch_get_item.py::test_batch_items_should_return_16mb_max"
] |
getmoto__moto-6734 | Thanks for the report! I am able to reproduce it on your project.
```
qregs OverloadedFuncDef:72(
Overload(def (self: qiskit.circuit.library.blueprintcircuit.BlueprintCircuit) -> Any)
Decorator:72(
Var(qregs)
FuncDef:73(
qregs
Args(
Var(self))
Property
Block:73(
... | diff --git a/moto/rds/models.py b/moto/rds/models.py
--- a/moto/rds/models.py
+++ b/moto/rds/models.py
@@ -1136,6 +1136,9 @@ def __init__(
self.status = "complete"
self.created_at = iso_8601_datetime_with_milliseconds(datetime.datetime.now())
+ self.source_type = (
+ "SNAPSHOT" if ... | diff --git a/tests/test_emr/test_emr_cloudformation.py b/tests/test_emr/test_emr_cloudformation.py
--- a/tests/test_emr/test_emr_cloudformation.py
+++ b/tests/test_emr/test_emr_cloudformation.py
@@ -632,3 +632,195 @@ def test_create_cluster_with_kerberos_attrs():
emr.describe_security_configuration(Name="mysec... | 2023-03-11 23:43:29 | Recursion error with nested Union
**Crash Report**
Many of my functions take `Iter = Union[Iterator[T], Iterable[T]]` as arguments. As `for` and many other functions in Python work with both iterators and iterables. However when I use `Iter[Iter[T]]` the code can break.
I've used `Iter[Iter[Iter[int]]]` as an exa... | getmoto/moto | 53efd628c44d35528a2908924fc722c5d9b97ead | 4.1 | [
"tests/test_awslambda/test_lambda.py::test_publish_version_unknown_function[bad_function_name]",
"tests/test_awslambda/test_lambda.py::test_create_function_from_zipfile",
"tests/test_awslambda/test_lambda.py::test_create_function_with_already_exists",
"tests/test_awslambda/test_lambda.py::test_get_function_co... | [
"tests/test_glue/test_datacatalog.py::test_delete_table_version"
] |
python__mypy-14064 | diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py
--- a/moto/awslambda/models.py
+++ b/moto/awslambda/models.py
@@ -371,6 +371,11 @@ def __init__(self, spec: Dict[str, Any], account_id: str, region: str):
self.code_sha_256,
self.code_digest,
) = ... | diff --git a/tests/test_elbv2/test_elbv2.py b/tests/test_elbv2/test_elbv2.py
--- a/tests/test_elbv2/test_elbv2.py
+++ b/tests/test_elbv2/test_elbv2.py
@@ -30,10 +30,12 @@ def test_create_load_balancer():
)
lb.get("CreatedTime").tzinfo.should_not.be.none
lb.get("State").get("Code").should.equal("provision... | 2024-02-18 21:06:40 | Generic type parameters to Argument 1 of `attrs.evolve` only unify under very specific circumstances (mypy 1.2)
<!--
If you're not sure whether what you're experiencing is a mypy bug, please see the "Question and Help" form instead.
Please consider:
- checking our common issues page: https://mypy.readthedocs.io/en... | getmoto/moto | afa34ffd8d727c3e67d0fa8d515f498ba165fbe1 | 3.1 | [
"mypy/test/testcheck.py::TypeCheckSuite::check-enum.test::testEnumReachabilityChecksBasic",
"mypy/test/testcheck.py::TypeCheckSuite::check-enum.test::testNewSetsUnexpectedValueType",
"mypy/test/testmerge.py::ASTMergeSuite::merge.test::testLiteralMerge"
] | [
"tests/test_route53/test_route53.py::test_change_resource_record_set_twice"
] | |
python__mypy-14038 | Hi @rolandcrosby-dbt, thanks for raising this! Looks like this is simply a bug in Moto where we do not handle the `encrypt(KeyId=alias)`-case properly. | diff --git a/moto/redshift/models.py b/moto/redshift/models.py
--- a/moto/redshift/models.py
+++ b/moto/redshift/models.py
@@ -157,6 +157,7 @@ def __init__(
self.restored_from_snapshot = restored_from_snapshot
self.kms_key_id = kms_key_id
self.cluster_snapshot_copy_status: Optional[Dict[str, ... | diff --git a/tests/test_ssm/test_ssm_boto3.py b/tests/test_ssm/test_ssm_boto3.py
--- a/tests/test_ssm/test_ssm_boto3.py
+++ b/tests/test_ssm/test_ssm_boto3.py
@@ -1713,6 +1713,7 @@ def test_send_command():
cmd["OutputS3KeyPrefix"].should.equal("pref")
cmd["ExpiresAfter"].should.be.greater_than(before)
+ ... | 2021-06-09T15:13:30Z | Creating mock AutoScalingGroups doesn't allow string versions for Launch templates
**Environment:**
* Running as a python library
* Moto version: moto==2.2.9
* Boto versions: boto3==1.16.23, botocore==1.19.23
Mock autoscaling assumes that the Launch template versions will always be integers. Both [boto](... | getmoto/moto | 2d5ae58120d4a5990d8c73810fa996bb16269a6e | 4.0 | [
"tests/test_cognitoidentity/test_cognitoidentity.py::test_describe_identity_pool_with_invalid_id_raises_error",
"tests/test_cognitoidentity/test_cognitoidentity.py::test_get_id__unknown_region",
"tests/test_cognitoidentity/test_cognitoidentity.py::test_create_identity_pool_invalid_name[pool#name]",
"tests/tes... | [
"tests/test_logs/test_export_tasks.py::test_create_export_executes_export_task",
"tests/test_logs/test_logs_query/test_boto3.py::test_start_query__unknown_log_group",
"tests/test_logs/test_integration.py::test_delete_subscription_filter_errors",
"tests/test_logs/test_logs.py::test_describe_subscription_filter... |
getmoto__moto-5306 | diff --git a/moto/s3/responses.py b/moto/s3/responses.py
--- a/moto/s3/responses.py
+++ b/moto/s3/responses.py
@@ -25,6 +25,7 @@
from .exceptions import (
BucketAlreadyExists,
+ BucketAccessDeniedError,
BucketMustHaveLockeEnabled,
DuplicateTagKeys,
InvalidContentMD5,
@@ -954,9 +955,13 @@ def _... | diff --git a/tests/test_dynamodb/test_dynamodb.py b/tests/test_dynamodb/test_dynamodb.py
--- a/tests/test_dynamodb/test_dynamodb.py
+++ b/tests/test_dynamodb/test_dynamodb.py
@@ -6,7 +6,7 @@
from boto3.dynamodb.conditions import Attr, Key
import re
import sure # noqa # pylint: disable=unused-import
-from moto impor... | 2023-08-21 18:57:36 | DeliveryTimedOutCount missing from ssm list_commands output
```python
import boto3
from moto import mock_ssm
mock = mock_ssm()
mock.start()
client = boto3.client("ssm", region_name="us-east-1")
client.send_command(DocumentName="AWS-RunShellScript", Parameters={"commands": ["ls"]})
response = client.list_... | getmoto/moto | 952ca239e6126aff52067a37869bd394eb08cf21 | 4.0 | [] | [
"tests/test_dynamodb/models/test_key_condition_expression_parser.py::TestHashAndRangeKey::test_brackets[(job_id",
"tests/test_dynamodb/models/test_key_condition_expression_parser.py::TestHashAndRangeKey::test_brackets[job_id"
] | |
python__mypy-9906 | > self._ref # should be inferred as `B`
It should not be `B`, it should still be `Self` (otherwise `return self` will fail in a method annotated with `-> Self`), but it should be a different `Self`, the one of the subclass. | diff --git a/moto/events/models.py b/moto/events/models.py
--- a/moto/events/models.py
+++ b/moto/events/models.py
@@ -96,7 +96,7 @@ def disable(self) -> None:
def delete(self, account_id: str, region_name: str) -> None:
event_backend = events_backends[account_id][region_name]
- event_backend.del... | diff --git a/test-data/unit/check-dataclasses.test b/test-data/unit/check-dataclasses.test
--- a/test-data/unit/check-dataclasses.test
+++ b/test-data/unit/check-dataclasses.test
@@ -1207,7 +1207,7 @@ class A2:
from dataclasses import dataclass
@dataclass
-class A: # E: Name "x" already defined (possibly by an imp... | 2022-05-01 19:20:43 | types-google-cloud-ndb is recommended incorrectly
**Bug Report**
this stub package only provides the `google.cloud.ndb.*` namespace -- however it is suggested for any missing google import
**To Reproduce**
```python
from google.cloud.exceptions import NotFound
```
**Expected Behavior**
it should not ... | getmoto/moto | d37c2be0f7a2002a0a8c160622d937518f902cc7 | 0.820 | [
"tests/test_rds/test_rds.py::test_create_parameter_group_with_tags",
"tests/test_rds/test_rds.py::test_describe_db_snapshots",
"tests/test_rds/test_rds_clusters.py::test_create_db_cluster_snapshot_fails_for_unknown_cluster",
"tests/test_rds/test_rds.py::test_get_non_existent_security_group",
"tests/test_rds... | [
"tests/test_ec2/test_vpcs.py::test_describe_vpc_gateway_end_points"
] |
getmoto__moto-5734 | Thanks for raising this @michuer, and welcome to Moto! Marking it as an enhancement to support this parameter. | diff --git a/moto/kinesis/models.py b/moto/kinesis/models.py
--- a/moto/kinesis/models.py
+++ b/moto/kinesis/models.py
@@ -4,6 +4,7 @@
import itertools
from operator import attrgetter
+from typing import Any, Dict, List, Optional, Tuple
from moto.core import BaseBackend, BackendDict, BaseModel, CloudFormationMod... | diff --git a/test-data/unit/check-assert-type-fail.test b/test-data/unit/check-assert-type-fail.test
new file mode 100644
--- /dev/null
+++ b/test-data/unit/check-assert-type-fail.test
@@ -0,0 +1,28 @@
+[case testAssertTypeFail1]
+import typing
+import array as arr
+class array:
+ pass
+def f(si: arr.array[int]):
+ ... | 2022-12-20 19:43:34 | [MultiAccount] S3 Bucket created by another account can be retrieved by list_objects_v2
test.py
```python
from moto import mock_s3
import boto3
import os
@mock_s3
def s3_test():
s3 = boto3.client("s3")
# Create test_1 bucket with account ID 111111111111
os.environ["MOTO_ACCOUNT_ID"] = "1111111111... | getmoto/moto | 6da12892a3c18248a2cfe55bc7d2cb3039817684 | 4.2 | [] | [
"mypy/test/testcheck.py::TypeCheckSuite::check-enum.test::testEnumLiteralValues"
] |
getmoto__moto-5343 | diff --git a/moto/apigateway/exceptions.py b/moto/apigateway/exceptions.py
--- a/moto/apigateway/exceptions.py
+++ b/moto/apigateway/exceptions.py
@@ -1,26 +1,34 @@
from moto.core.exceptions import JsonRESTError
-class BadRequestException(JsonRESTError):
+class ApiGatewayException(JsonRESTError):
pass
-cl... | diff --git a/test-data/unit/check-final.test b/test-data/unit/check-final.test
--- a/test-data/unit/check-final.test
+++ b/test-data/unit/check-final.test
@@ -1109,3 +1109,11 @@ class A(ABC):
@final # E: Method B is both abstract and final
@abstractmethod
def B(self) -> None: ...
+
+[case testFinalClassV... | 2023-02-16 23:00:33 | mypy does not check the code after the line with lambda function that calls NoReturn function
**Bug Report**
mypy does not check the code after the line with lambda function that calls NoReturn function
**To Reproduce**
Check the code below. I also attached a mypy Playground link.
```python
from typing import ... | getmoto/moto | 551df91ddfe4ce2f5e7607e97ae95d73ebb39d11 | 4.2 | [
"mypy/test/testcheck.py::TypeCheckSuite::check-statements.test::testOverloadedExceptionType"
] | [
"tests/test_sesv2/test_sesv2.py::test_send_email"
] | |
getmoto__moto-7168 | Same assertion is hit in #12113, #10140, #10672, #12252 and #12112 | diff --git a/moto/kms/models.py b/moto/kms/models.py
--- a/moto/kms/models.py
+++ b/moto/kms/models.py
@@ -3,8 +3,8 @@
from collections import defaultdict
from datetime import datetime, timedelta
-from moto.core import get_account_id, BaseBackend, CloudFormationModel
-from moto.core.utils import unix_time, BackendD... | diff --git a/tests/test_ec2/test_key_pairs.py b/tests/test_ec2/test_key_pairs.py
--- a/tests/test_ec2/test_key_pairs.py
+++ b/tests/test_ec2/test_key_pairs.py
@@ -254,3 +254,51 @@ def test_key_pair_filters_boto3():
Filters=[{"Name": "fingerprint", "Values": [kp3.key_fingerprint]}]
)["KeyPairs"]
asser... | 2023-04-14 19:13:35 | [Terraform] Creation of Guardduty GetDetector return 404
Hello, i tried to use moto as mock server for terraform code testing, during guardduty creation i got in debug mode error like
**Repro steps**:
Start moto server
Configure AWS provider for using custom endpoint
Create simple aws_guardduty_detector resourc... | getmoto/moto | 26904fdb366fd3fb7be7fbf3946dc07966b26e58 | 4.1 | [
"tests/test_autoscaling/test_autoscaling_groups.py::TestAutoScalingGroup::test_create_autoscaling_groups_defaults",
"tests/test_autoscaling/test_autoscaling.py::test_create_auto_scaling_from_template_version__latest",
"tests/test_autoscaling/test_autoscaling_groups.py::TestAutoScalingGroup::test_resume_processe... | [
"mypy/test/testcheck.py::TypeCheckSuite::check-python310.test::testMatchCapturePatternFromFunctionReturningUnion"
] |
python__mypy-9663 | diff --git a/moto/dynamodb/models/table.py b/moto/dynamodb/models/table.py
--- a/moto/dynamodb/models/table.py
+++ b/moto/dynamodb/models/table.py
@@ -707,6 +707,24 @@ def query(
if isinstance(item, Item) and item.hash_key == hash_key
]
+ # SORT
+ if index_name:
+ ... | diff --git a/tests/test_ec2/test_instances.py b/tests/test_ec2/test_instances.py
--- a/tests/test_ec2/test_instances.py
+++ b/tests/test_ec2/test_instances.py
@@ -1990,6 +1990,22 @@ def test_modify_delete_on_termination():
instance.block_device_mappings[0]["Ebs"]["DeleteOnTermination"].should.be(False)
+@mock_... | 2022-11-03 07:21:20 | Crash with alembic 1.7.0
**Crash Report**
Running `mypy` in a simple file which uses type annotations from [`alembic`](https://github.com/sqlalchemy/alembic) `1.7.0` gives a crash. Works fine with `1.6.5 .
**Traceback**
```
Traceback (most recent call last):
File "C:\Python39\lib\runpy.py", line 197, in ... | getmoto/moto | 6b70cd1b6b1cf493b66b6fcaaea9d1041331e836 | 0.820 | [
"tests/test_ec2/test_security_groups.py::test_authorize_other_group_and_revoke",
"tests/test_ec2/test_security_groups.py::test_authorize_all_protocols_with_no_port_specification",
"tests/test_ec2/test_security_groups.py::test_get_all_security_groups_filter_with_same_vpc_id",
"tests/test_ec2/test_security_grou... | [
"mypy/test/testcheck.py::TypeCheckSuite::testNewReturnType10",
"mypy/test/testcheck.py::TypeCheckSuite::testNewReturnType11",
"mypy/test/testcheck.py::TypeCheckSuite::testNewReturnType12"
] | |
getmoto__moto-5043 | Reposting what I posted in #14264 (a duplicate of this issue):
It looks like the bug is specific to pattern-matching; mypy has no problems with this version of the same function using `if/else` idioms (and it will correctly identify the `else` branch as unreachable if you add a call to `reveal_type`):
```python
... | diff --git a/moto/dynamodb/comparisons.py b/moto/dynamodb/comparisons.py
--- a/moto/dynamodb/comparisons.py
+++ b/moto/dynamodb/comparisons.py
@@ -10,7 +10,7 @@
def get_filter_expression(
expr: Optional[str],
names: Optional[Dict[str, str]],
- values: Optional[Dict[str, str]],
+ values: Optional[Dict[s... | diff --git a/tests/terraformtests/terraform-tests.success.txt b/tests/terraformtests/terraform-tests.success.txt
--- a/tests/terraformtests/terraform-tests.success.txt
+++ b/tests/terraformtests/terraform-tests.success.txt
@@ -367,6 +367,13 @@ lambda:
- TestAccLambdaFunctionURL_Alias
- TestAccLambdaFunctionURL_ba... | 2022-05-14 01:52:33 | Cloudfront - CustomHeaders in origin missing
I'm trying to test an update of a custom header on an origin, but when I create the distribution, the customHeaders field is always empty (`{'Quantity': 0, 'Items': []}`). If I update the distribution still having same issue.
```python
import unittest
from moto import m... | getmoto/moto | e379afe04e126418bdac8949238d4a2d74e2f3b7 | 4.1 | [
"tests/test_autoscaling/test_autoscaling.py::test_create_auto_scaling_from_template_version__latest",
"tests/test_autoscaling/test_autoscaling.py::test_set_instance_health",
"tests/test_autoscaling/test_autoscaling.py::test_create_autoscaling_policy_with_policytype__targettrackingscaling",
"tests/test_autosca... | [
"tests/test_core/test_decorator_calls.py::TestWithSetup_LowercaseU::test_should_find_bucket",
"tests/test_core/test_decorator_calls.py::TestWithSetupMethod::test_should_find_bucket"
] |
getmoto__moto-5502 | Thanks for providing the repro @patstrom! Marking it as a bug.
There is no way to use the public api to change this, but I'll raise a PR soon to fix it. | diff --git a/moto/ec2/models/flow_logs.py b/moto/ec2/models/flow_logs.py
--- a/moto/ec2/models/flow_logs.py
+++ b/moto/ec2/models/flow_logs.py
@@ -253,11 +253,8 @@ def create_flow_logs(
all_flow_logs = self.describe_flow_logs()
if any(
- fl.resource_id == resource_id
- ... | diff --git a/tests/test_iot/test_iot_policies.py b/tests/test_iot/test_iot_policies.py
--- a/tests/test_iot/test_iot_policies.py
+++ b/tests/test_iot/test_iot_policies.py
@@ -33,6 +33,10 @@ def test_attach_policy(iot_client, policy):
res.should.have.key("policies").which.should.have.length_of(1)
res["policies... | 2021-11-28T11:13:18Z | DynamoDB: transact_write_items does not return Item in CancellationReasons
moto does not appear to return `Item` under `err.response["CancellationReasons"][n]` when a transaction fails, and we've set ` "ReturnValuesOnConditionCheckFailure": "ALL_OLD"`.
I've created a minimal repro with a failing test case here: http... | getmoto/moto | 455fbd5eaa0270e03eac85a532e47ec75c7acd21 | 3.1 | [] | [
"tests/test_organizations/test_organizations_boto3.py::test_list_accounts_pagination"
] |
getmoto__moto-4975 | diff --git a/moto/ses/models.py b/moto/ses/models.py
--- a/moto/ses/models.py
+++ b/moto/ses/models.py
@@ -127,7 +127,7 @@ class SESBackend(BaseBackend):
from moto.core import DEFAULT_ACCOUNT_ID
from moto.ses import ses_backends
- ses_backend = ses_backends[DEFAULT_ACCOUNT_ID]["global"]
+ ... | diff --git a/tests/test_awslambda/test_lambda_policy.py b/tests/test_awslambda/test_lambda_policy.py
--- a/tests/test_awslambda/test_lambda_policy.py
+++ b/tests/test_awslambda/test_lambda_policy.py
@@ -41,6 +41,45 @@ def test_add_function_permission(key):
assert "Statement" in response
res = json.loads(respo... | 2022-07-15 15:32:44 | delete_secret accepts invalid input and then fails
The following call is accepted by moto `delete_secret` validations but runtime AWS error is issued
```
self.secrets_client.delete_secret(
SecretId=creds_name,
RecoveryWindowInDays=0,
ForceDeleteWithoutR... | getmoto/moto | d3f5e3d68b0517be1172319087ee68c0834a157a | 4.1 | [
"tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_query_gsi_with_wrong_key_attribute_names_throws_exception",
"tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_update_primary_key",
"tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_update_expression_with_trailing_c... | [
"tests/test_kinesis/test_kinesis_stream_limits.py::test_too_many_records",
"tests/test_kinesis/test_kinesis_stream_limits.py::test_total_record_data_exceeds_5mb",
"tests/test_kinesis/test_kinesis_stream_limits.py::test_record_data_exceeds_1mb"
] | |
getmoto__moto-7331 | It's worth noting that a very similar problem occurs when the identifier in the `except` clause is declared `global`, but that identifier is not declared in the outside scope:
```
# Note that e is not defined out here
def main()
global e
try:
...
except Exception as e:
pass
```
... | diff --git a/moto/dynamodb/models/__init__.py b/moto/dynamodb/models/__init__.py
--- a/moto/dynamodb/models/__init__.py
+++ b/moto/dynamodb/models/__init__.py
@@ -1381,9 +1381,7 @@ def get_table_keys_name(self, table_name, keys):
for key in keys:
if key in table.hash_key_names:
... | diff --git a/tests/test_kinesis/test_kinesis.py b/tests/test_kinesis/test_kinesis.py
--- a/tests/test_kinesis/test_kinesis.py
+++ b/tests/test_kinesis/test_kinesis.py
@@ -137,6 +137,26 @@ def test_describe_stream_summary():
assert stream["StreamName"] == stream_name
+@mock_aws
+def test_list_streams_stream_dis... | 2023-09-26 17:21:36 | Improved hinting / warning diagnostics where parameter named `self` is missing on instance method
The code below is faulty - mypy correctly emits an error "Too many arguments for "set_log_level"":
```python
class LoggableDB:
def set_log_level(v):
print(type(v).__name__)
LoggableDB().set_log_level("i ... | getmoto/moto | 3d3e482e03c1efeaca9a1033acf06f56c1dfdf86 | 1.7 | [
"tests/test_sqs/test_sqs.py::test_message_with_attributes_have_labels",
"tests/test_sqs/test_sqs.py::test_create_queue_with_tags",
"tests/test_sqs/test_sqs.py::test_fifo_send_receive_message_with_attribute_name[ApproximateReceiveCount]",
"tests/test_sqs/test_sqs.py::test_untag_queue_errors",
"tests/test_sqs... | [
"tests/test_firehose/test_firehose_encryption.py::test_stop_encryption_on_unknown_stream",
"tests/test_firehose/test_http_destinations.py::test_update_s3_for_http_stream",
"tests/test_firehose/test_firehose_encryption.py::test_firehose_with_encryption",
"tests/test_firehose/test_firehose_encryption.py::test_f... |
python__mypy-11713 | diff --git a/moto/scheduler/models.py b/moto/scheduler/models.py
--- a/moto/scheduler/models.py
+++ b/moto/scheduler/models.py
@@ -39,6 +39,7 @@ def __init__(
self.kms_key_arn = kms_key_arn
self.start_date = start_date
self.end_date = end_date
+ self.creation_date = self.last_modified_... | diff --git a/tests/test_cognitoidentity/test_cognitoidentity.py b/tests/test_cognitoidentity/test_cognitoidentity.py
--- a/tests/test_cognitoidentity/test_cognitoidentity.py
+++ b/tests/test_cognitoidentity/test_cognitoidentity.py
@@ -1,11 +1,15 @@
import boto3
+import mock
import sure # noqa # pylint: disable=unuse... | 2022-10-01 21:28:36 | Calls to list_attached_policies fail with ARN targets
Hi,
there's a slight issue with ARN targets when calling `list_attached_policies`.
Versions:
```
boto3==1.26.33
botocore==1.29.33
moto==4.0.12
```
Python 3.11
Fixtures I'm using:
```python
@pytest.fixture(scope="session")
def aws_credentials():... | getmoto/moto | 12843c4eaedcfc524538eb43483fbb011bf05c85 | 1.7 | [
"tests/test_dynamodb/test_dynamodb.py::test_remove_list_index__remove_existing_nested_index",
"tests/test_dynamodb/test_dynamodb.py::test_basic_projection_expressions_using_query_with_attr_expression_names",
"tests/test_dynamodb/test_dynamodb.py::test_transact_write_items_put_conditional_expressions_return_valu... | [
"tests/test_cloudformation/test_cloudformation_custom_resources.py::test_create_custom_lambda_resource__unknown_arn"
] | |
getmoto__moto-5258 | Hi @sergargar! I'm not too familiar with this area, so apologies if this is an obvious question:
Does AWS create an actual IAM policy for you, using either the provided `policy_document`-value or the default? That is currently not supported in Moto either - from what I can see, we only persist the `policy-document`-va... | diff --git a/mypy/semanal.py b/mypy/semanal.py
--- a/mypy/semanal.py
+++ b/mypy/semanal.py
@@ -5569,7 +5569,7 @@ def lookup(
if not suppress_errors:
self.name_not_defined(name, ctx)
return None
- # 2. Class attributes (if within class definition)
+ # 2a. Class at... | diff --git a/tests/test_dynamodb/test_dynamodb_expression_tokenizer.py b/tests/test_dynamodb/test_dynamodb_expression_tokenizer.py
--- a/tests/test_dynamodb/test_dynamodb_expression_tokenizer.py
+++ b/tests/test_dynamodb/test_dynamodb_expression_tokenizer.py
@@ -231,6 +231,18 @@ def test_expression_tokenizer_single_set... | 2023-11-15 20:20:55 | moto batch - "RuntimeError: cannot join thread before it is started"
Hey,
**after upgrading from moto 4.0.11 to 4.2.11** i am facing the following issue with my previously running pytest. The first test is successfull, the second test, essentially doing the same but with different input, fails.
This is the **trac... | python/mypy | ff8cebbcf5094012ee914308dc4f9ecaa7f4684c | 3.1 | [
"tests/test_rds/test_rds.py::test_create_parameter_group_with_tags",
"tests/test_rds/test_rds.py::test_describe_db_snapshots",
"tests/test_rds/test_rds_clusters.py::test_modify_db_cluster_needs_long_master_user_password",
"tests/test_rds/test_filters.py::TestDBInstanceFilters::test_valid_db_instance_identifie... | [
"mypy/test/testcheck.py::TypeCheckSuite::testNestedProtocolGenericUnionsDeep",
"mypy/test/testcheck.py::TypeCheckSuite::testNestedProtocolGenericUnions"
] |
getmoto__moto-4875 | Digging into it a bit more this seems to be intentional:
https://github.com/python/mypy/blob/e46aa6df6126cf47bea97bf9f94d7cba093d0103/mypy/build.py#L2446-L2452
However even putting the more specific, non-global ignore in config (eg `[mypy-redis.*] ignore_missing_imports = True`) fails to suppress the error as long as... | diff --git a/moto/rds/models.py b/moto/rds/models.py
--- a/moto/rds/models.py
+++ b/moto/rds/models.py
@@ -182,7 +182,7 @@ def __init__(self, **kwargs: Any):
self.preferred_backup_window = "01:37-02:07"
self.preferred_maintenance_window = "wed:02:40-wed:03:10"
# This should default to the def... | diff --git a/tests/terraform-tests.failures.txt b/tests/terraform-tests.failures.txt
--- a/tests/terraform-tests.failures.txt
+++ b/tests/terraform-tests.failures.txt
@@ -8,9 +8,4 @@ TestAccAWSDefaultSecurityGroup_Classic_
TestAccDataSourceAwsNetworkInterface_CarrierIPAssociation
TestAccAWSRouteTable_IPv4_To_LocalGat... | 2023-06-24 08:56:14 | Scheduler should raise ResourceNotFoundException for delete_schedule if not exists
Calling delete_schedule for unknown schedule name raises KeyError instead of ResourceNotFoundException.
```
File "/Source/SH-service/.venv/lib/python3.8/site-packages/moto/scheduler/responses.py", line 60, in delete_schedule
sel... | getmoto/moto | 8b6d21373f44959d8aa194723e871e5468ad5c71 | 4.1 | [
"tests/test_glue/test_datacatalog.py::test_delete_database",
"tests/test_glue/test_datacatalog.py::test_create_partition_already_exist",
"tests/test_glue/test_datacatalog.py::test_get_partitions_empty",
"tests/test_glue/test_datacatalog.py::test_create_database",
"tests/test_glue/test_datacatalog.py::test_b... | [
"tests/test_athena/test_athena.py::test_get_query_execution"
] |
python__mypy-11867 | diff --git a/mypy/modulefinder.py b/mypy/modulefinder.py
--- a/mypy/modulefinder.py
+++ b/mypy/modulefinder.py
@@ -627,6 +627,25 @@ def _make_abspath(path: str, root: str) -> str:
return os.path.join(root, os.path.normpath(path))
+def add_py2_mypypath_entries(mypypath: List[str]) -> List[str]:
+ """Add ... | diff --git a/tests/test_autoscaling/test_autoscaling.py b/tests/test_autoscaling/test_autoscaling.py
--- a/tests/test_autoscaling/test_autoscaling.py
+++ b/tests/test_autoscaling/test_autoscaling.py
@@ -148,7 +148,7 @@ def test_create_auto_scaling_from_template_version__latest():
"LaunchTemplateName": laun... | 2024-03-08 21:12:25 | Treat bool as equivalent to Literal[True, False] to allow better type inference
Similar to this https://github.com/python/mypy/issues/6027, but more basic use case.
```python
from typing import Collection, Union, List
def foo(bar: Union[bool, Collection[int]]) -> Union[int, List[int]]:
if bar is False: #... | python/mypy | c8bae06919674b9846e3ff864b0a44592db888eb | 4.1 | [
"tests/test_ec2/test_spot_fleet.py::test_modify_spot_fleet_request_up",
"tests/test_ec2/test_spot_fleet.py::test_create_spot_fleet_with_lowest_price",
"tests/test_ec2/test_spot_fleet.py::test_modify_spot_fleet_request_down",
"tests/test_ec2/test_spot_fleet.py::test_modify_spot_fleet_request_down_no_terminate_... | [
"mypy/test/testcheck.py::TypeCheckSuite::check-modules.test::testImportWithinClassBody2",
"mypy/test/testcheck.py::TypeCheckSuite::check-classes.test::testClassScopeImports",
"mypy/test/testcheck.py::TypeCheckSuite::check-classes.test::testClassScopeImportAlias",
"mypy/test/testcheck.py::TypeCheckSuite::check... | |
getmoto__moto-7635 | Interesting. I guess for now you can silence mypy with `# type: ignore` but
you're right, ideally this ought to be special-cased. Truth be told there
are probably some more magical functions in the stdlib for which we
shouldn't insist on Liskov. I'm not sure where to go from here -- maybe you
can find where `__init__` ... | diff --git a/moto/s3/models.py b/moto/s3/models.py
--- a/moto/s3/models.py
+++ b/moto/s3/models.py
@@ -2524,7 +2524,7 @@ def __init__(
# Maps bucket names to account IDs. This is used to locate the exact S3Backend
# holding the bucket and to maintain the common bucket namespace.
- self.bucket... | diff --git a/test-data/unit/check-redefine.test b/test-data/unit/check-redefine.test
--- a/test-data/unit/check-redefine.test
+++ b/test-data/unit/check-redefine.test
@@ -474,3 +474,12 @@ with A() as x:
reveal_type(x) # N: Revealed type is "builtins.int"
with B() as x:
x = 0 # E: Incompatible types in assign... | 2021-01-12T23:33:11Z | Incorrect Error with NamedTuple slices ?
Assuming the following file:
```
$ cat foo.py
from typing import NamedTuple, List, Tuple, Sequence
from typing import NamedTuple, List, Sequence
class NT(NamedTuple):
matched_text: str
matches: Sequence[str] # Sequence will not match List below
match... | python/mypy | b4f0fb7137bdcb5b78d928d2ed1e751e9e1b2bdc | 4.0 | [
"mypy/test/testcheck.py::TypeCheckSuite::check-abstract.test::testInstantiationAbstractsInTypeForAliases"
] | [
"tests/test_secretsmanager/test_secretsmanager.py::test_delete_secret_by_arn"
] |
python__mypy-16717 | diff --git a/moto/dynamodb/exceptions.py b/moto/dynamodb/exceptions.py
--- a/moto/dynamodb/exceptions.py
+++ b/moto/dynamodb/exceptions.py
@@ -310,3 +310,9 @@ class StreamAlreadyEnabledException(JsonRESTError):
def __init__(self):
er = "com.amazonaws.dynamodb.v20111205#ResourceInUseException"
sup... | diff --git a/tests/test_batch/test_batch_jobs.py b/tests/test_batch/test_batch_jobs.py
--- a/tests/test_batch/test_batch_jobs.py
+++ b/tests/test_batch/test_batch_jobs.py
@@ -72,11 +72,12 @@ def test_submit_job_by_name():
resp = batch_client.submit_job(
jobName="test1", jobQueue=queue_arn, jobDefinition=j... | 2022-01-13T12:02:41Z | Cloudfront - get_distribution() does not return same config passed to create_distribution()
When passing in a fully-formed Cloudfront Distribution Configuration, the response back from `create_distribution()` does not contain all of the information passed in. Calling `get_distribution()` with the Id passed back from `... | getmoto/moto | ba90dc48fef38e48f0615f1f742a767fcde70fa9 | 4.2 | [] | [
"tests/test_ec2/test_regions.py::test_describe_zones_and_get_instance_types[us-west-1]",
"tests/test_elb/test_elb_cloudformation.py::test_stack_elb_integration_with_update",
"tests/test_elbv2/test_elbv2.py::test_create_elb_in_multiple_region",
"tests/test_ec2/test_vpc_endpoint_services_integration.py::test_de... | |
getmoto__moto-5086 | https://github.com/spulec/moto/blob/ab045f5bebff4de84ac33053ef764efa32405829/moto/autoscaling/models.py#L888
Going to mark this as an enhancement instead, as we just need to add support for that parameter. | diff --git a/mypy/checkmember.py b/mypy/checkmember.py
--- a/mypy/checkmember.py
+++ b/mypy/checkmember.py
@@ -735,12 +735,12 @@ def analyze_var(
"""Analyze access to an attribute via a Var node.
This is conceptually part of analyze_member_access and the arguments are similar.
-
- itype is the class obje... | diff --git a/tests/terraformtests/terraform-tests.success.txt b/tests/terraformtests/terraform-tests.success.txt
--- a/tests/terraformtests/terraform-tests.success.txt
+++ b/tests/terraformtests/terraform-tests.success.txt
@@ -135,8 +135,10 @@ iam:
iot:
- TestAccIoTEndpointDataSource
kinesis:
- - TestAccKinesisSt... | 2023-07-10 20:47:04 | mock_athena fails to get "primary" work group
Hello! After upgrading from moto version 4.1.4 to 4.1.7, we now experience errors when performing the `athena_client.get_work_group(WorkGroup="primary")` call. Querying any other work group than "primary" (existent or non-existent work groups) works fine.
The only code a... | getmoto/moto | 1b2dfbaf569d21c5a3a1c35592325b09b3c697f4 | 0.800 | [
"mypy/test/testcheck.py::TypeCheckSuite::testDataclassGenericSubtype",
"mypy/test/testcheck.py::TypeCheckSuite::testDataclassGenericsClassmethod"
] | [
"tests/test_awslambda/test_lambda.py::test_update_function_ecr"
] |
getmoto__moto-5175 | diff --git a/mypy/checkmember.py b/mypy/checkmember.py
--- a/mypy/checkmember.py
+++ b/mypy/checkmember.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import TYPE_CHECKING, Callable, Sequence, cast
+from typing import TYPE_CHECKING, Callable, Optional, Sequence, cast
from mypy import meet, m... | diff --git a/tests/test_iot/test_iot_search.py b/tests/test_iot/test_iot_search.py
--- a/tests/test_iot/test_iot_search.py
+++ b/tests/test_iot/test_iot_search.py
@@ -22,11 +22,15 @@ def test_search_things(query_string, results):
client.create_thing(thingName=name)
resp = client.search_index(queryString... | 2021-07-21T17:41:19Z | Fix: Moto Doesn't Support Boto3 ListSecrets Key Filters for: 'primary-region', 'owning-service' etc.
Via this section in Moto: https://github.com/getmoto/moto/blob/master/moto/secretsmanager/models.py#L29
It's clear that Moto is not currently supporting the same criteria that Boto supports for Key Filter values. Th... | getmoto/moto | 5580b519e0a9af926a9e7fdc61bfe680f907f7a3 | 4.0 | [] | [
"tests/test_rds/test_rds_clusters.py::test_create_db_cluster__verify_default_properties"
] | |
python__mypy-16013 | Hi @crbunney, thanks for raising this - marking it as a bug.
An additional workaround is to remove the `tearDown`-method altogether for this example - Moto will reset the state automatically at the beginning of each test.
I'll make sure this is better reflected in the documentation. | diff --git a/moto/cloudfront/models.py b/moto/cloudfront/models.py
--- a/moto/cloudfront/models.py
+++ b/moto/cloudfront/models.py
@@ -113,7 +113,6 @@ def __init__(self, origin: Dict[str, Any]):
self.id = origin["Id"]
self.domain_name = origin["DomainName"]
self.origin_path = origin.get("Orig... | diff --git a/test-data/unit/check-dataclass-transform.test b/test-data/unit/check-dataclass-transform.test
--- a/test-data/unit/check-dataclass-transform.test
+++ b/test-data/unit/check-dataclass-transform.test
@@ -807,3 +807,217 @@ reveal_type(bar.base) # N: Revealed type is "builtins.int"
[typing fixtures/typing-... | 2020-10-22T00:20:58Z | cognito-idp admin_initiate_auth can't refresh token
## Reporting Bugs
moto==3.1.6
/moto/cognitoidp/[models.py](https://github.com/spulec/moto/tree/9a8c9f164a472598d78d30c78f4581810d945995/moto/cognitoidp/models.py)
function admin_initiate_auth line:1276
elif auth_flow is AuthFlow.REFRESH_TOKEN:
... | getmoto/moto | db862bcf3b5ea051d412620caccbc08d72c8f441 | 4.1 | [] | [
"mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testProperty_semanal"
] |
python__mypy-15449 | This looks like a bug. | diff --git a/moto/cloudfront/models.py b/moto/cloudfront/models.py
--- a/moto/cloudfront/models.py
+++ b/moto/cloudfront/models.py
@@ -113,6 +113,7 @@ class Origin:
def __init__(self, origin: Dict[str, Any]):
self.id = origin["Id"]
self.domain_name = origin["DomainName"]
+ self.origin_path... | diff --git a/tests/test_ec2/test_subnets.py b/tests/test_ec2/test_subnets.py
--- a/tests/test_ec2/test_subnets.py
+++ b/tests/test_ec2/test_subnets.py
@@ -354,6 +354,7 @@ def test_create_subnet_response_fields():
subnet.should.have.key("MapPublicIpOnLaunch").which.should.equal(False)
subnet.should.have.key("O... | 2023-08-01 16:59:37 | Multiply Tuple with IntExpr
`(1,)*3` should be of type `Tuple[int,int,int]`, not raise an exception.
I suppose `(1,)*n` may as well wait for proper tuple sequences, though.
| getmoto/moto | 796068d06a0ab171d22f7be555c28dfad57db433 | 4.1 | [
"tests/test_sns/test_application_boto3.py::test_set_endpoint_attributes",
"tests/test_sns/test_application_boto3.py::test_get_platform_application_attributes",
"tests/test_sns/test_application_boto3.py::test_delete_platform_application",
"tests/test_sns/test_application_boto3.py::test_list_platform_applicatio... | [
"tests/test_ec2/test_instances.py::test_run_instance_with_additional_args[False]",
"tests/test_ec2/test_instances.py::test_run_instance_with_additional_args[True]"
] |
getmoto__moto-5009 | Marking it as an enhancement! Thanks for raising this @edgarrmondragon. | diff --git a/moto/databrew/responses.py b/moto/databrew/responses.py
--- a/moto/databrew/responses.py
+++ b/moto/databrew/responses.py
@@ -1,5 +1,6 @@
import json
from typing import Any, Dict, Union
+from urllib.parse import unquote
from moto.core.common_types import TYPE_RESPONSE
from moto.core.responses import ... | diff --git a/tests/test_ec2/test_transit_gateway.py b/tests/test_ec2/test_transit_gateway.py
--- a/tests/test_ec2/test_transit_gateway.py
+++ b/tests/test_ec2/test_transit_gateway.py
@@ -446,6 +446,43 @@ def test_search_transit_gateway_routes_by_state():
routes.should.equal([])
+@mock_ec2
+def test_search_tran... | 2022-05-27 21:13:53 | Error handling for SNS mobile push does not match AWS
Currently, the Moto SNS mock raises an error with code `DuplicateEndpoint` when attempting to create a second platform endpoint using the same token.
This is not actually the behavior on AWS. On AWS, when attempting to do this, when not setting `CustomUserData`, ... | getmoto/moto | 55c589072fc88363fdde9ae8656909f8f24dd13f | 0.800 | [
"tests/test_apigateway/test_apigateway.py::test_get_model_by_name",
"tests/test_apigateway/test_apigateway.py::test_get_usage_plans_using_key_id",
"tests/test_apigateway/test_apigateway.py::test_delete_authorizer",
"tests/test_apigateway/test_apigateway.py::test_create_method_apikeyrequired",
"tests/test_ap... | [
"mypy/test/testcheck.py::TypeCheckSuite::testNarrowingUsingTypeVar"
] |
python__mypy-13648 | Thanks for the report! It does look related to the PR you mention.
Slightly smaller repro:
```
from typing_extensions import Self
from typing import Any, Generic, TypeVar, overload
T_co = TypeVar('T_co', covariant=True)
class Config(Generic[T_co]):
@overload
def get(self, instance: None) -> Self: ...
... | diff --git a/moto/organizations/models.py b/moto/organizations/models.py
--- a/moto/organizations/models.py
+++ b/moto/organizations/models.py
@@ -95,19 +95,6 @@ def create_account_status(self):
}
}
- @property
- def close_account_status(self):
- return {
- "CloseAccountS... | diff --git a/tests/test_applicationautoscaling/test_applicationautoscaling.py b/tests/test_applicationautoscaling/test_applicationautoscaling.py
--- a/tests/test_applicationautoscaling/test_applicationautoscaling.py
+++ b/tests/test_applicationautoscaling/test_applicationautoscaling.py
@@ -2,6 +2,7 @@
import pytest
i... | 2022-12-08 21:13:44 | Feat: Cloudformation Stack (as cludformation resource)
Stacks are already supported via `mock_cloudformation`
```
boto_cloudformation_client.create_stack(StackName=stack_name, TemplateBody=str(template_dict))
```
Would be good to be able to use cloudformation as well to create new stacks.
Example resource templa... | getmoto/moto | 3e11578a7288122e7f2c2a0238c3338f56f8582f | 3.1 | [
"tests/test_iot/test_iot_certificates.py::test_delete_certificate_with_status[REVOKED]",
"tests/test_iot/test_iot_certificates.py::test_delete_certificate_validation",
"tests/test_iot/test_iot_certificates.py::test_register_certificate_without_ca",
"tests/test_iot/test_iot_certificates.py::test_certs_create_i... | [
"tests/test_core/test_mock_regions.py::test_use_unknown_region_from_env_but_allow_it__dynamo"
] |
python__mypy-14680 | Thanks for raising this and providing the repro, @JonathanRohland-TNG! Marking it as a bug. | diff --git a/moto/dynamodb/exceptions.py b/moto/dynamodb/exceptions.py
--- a/moto/dynamodb/exceptions.py
+++ b/moto/dynamodb/exceptions.py
@@ -207,14 +207,14 @@ class TransactionCanceledException(DynamodbException):
def __init__(self, errors):
msg = self.cancel_reason_msg.format(
- ", ".join(... | diff --git a/tests/test_dynamodb/test_dynamodb_update_expressions.py b/tests/test_dynamodb/test_dynamodb_update_expressions.py
--- a/tests/test_dynamodb/test_dynamodb_update_expressions.py
+++ b/tests/test_dynamodb/test_dynamodb_update_expressions.py
@@ -89,3 +89,54 @@ def test_update_item_add_float(table_name=None):
... | 2023-11-30 22:25:53 | StateTransitionReason has no value after stopping an instance
Hi All,
I am struggling with getting moto 5.0.3 test run correctly. I have a code that reads StateTransitionReason date and makes calculations to find the difference. However, after stopping instance with moto:
```
reservation = ec2.create_instanc... | getmoto/moto | a18a0db0c77e71050aaf31a53ad1fba8c663fd1a | 4.1 | [
"tests/test_organizations/test_organizations_boto3.py::test_describe_organization",
"tests/test_organizations/test_organizations_boto3.py::test_aiservices_opt_out_policy",
"tests/test_organizations/test_organizations_boto3.py::test_list_accounts_pagination",
"tests/test_organizations/test_organizations_boto3.... | [
"tests/test_dynamodb/test_dynamodb_batch_get_item.py::test_batch_items_with_basic_projection_expression",
"tests/test_dynamodb/test_dynamodb.py::test_projection_expression_with_binary_attr",
"tests/test_dynamodb/test_dynamodb_batch_get_item.py::test_batch_items_returns_all"
] |
python__mypy-15164 | Surprisingly, with a regular identity as a decorator it works fine:
```python
from typing import Callable, TypeVar
C = TypeVar('C', bound=Callable)
def dec(f: C) -> C:
return f
lambda: foo() == 2
@dec
def foo() -> int:
return 2
```
Another surprising discovery: it also works fine when bot... | diff --git a/moto/core/responses.py b/moto/core/responses.py
--- a/moto/core/responses.py
+++ b/moto/core/responses.py
@@ -725,25 +725,19 @@ def _get_map_prefix(self, param_prefix, key_end=".key", value_end=".value"):
return results
- def _parse_tag_specification(self, param_prefix):
- tags = sel... | diff --git a/test-data/unit/check-recursive-types.test b/test-data/unit/check-recursive-types.test
--- a/test-data/unit/check-recursive-types.test
+++ b/test-data/unit/check-recursive-types.test
@@ -532,7 +532,14 @@ m: A
s: str = n.x # E: Incompatible types in assignment (expression has type "Tuple[A, int]", variable... | 2022-08-24 17:15:05 | DynamoDB Table.query() returns the wrong ScannedCount value
## Description
The `Table.query()` method returns the total number of items in the stable instead of the total number of items with the specified partition key.
## Steps to reproduce
```python
import boto3
from boto3.dynamodb.conditions import Key
... | python/mypy | 4d2ff58e502b52a908f41c18fbbe7cbb32997504 | 0.980 | [
"mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testOverload_fromTypingImport"
] | [
"tests/test_acm/test_acm.py::test_request_certificate_no_san",
"tests/test_acm/test_acm.py::test_describe_certificate"
] |
getmoto__moto-6726 | That's fun; I can repro. Thanks for the clear report.
Not that this isn't a bug, but note that Iterator is a subclass of Iterable (https://github.com/python/typeshed/blob/master/stdlib/3/typing.pyi#L177; every Iterator is also an Iterable), so the Union in your original example is redundant.
Thank you @JelleZijlstra. I... | diff --git a/moto/s3/models.py b/moto/s3/models.py
--- a/moto/s3/models.py
+++ b/moto/s3/models.py
@@ -57,6 +57,7 @@
from .utils import ARCHIVE_STORAGE_CLASSES, STORAGE_CLASS
from ..events.notifications import send_notification as events_send_notification
from ..settings import get_s3_default_key_buffer_size, S3_UPL... | diff --git a/tests/test_events/test_events_partners_integration.py b/tests/test_events/test_events_partners_integration.py
new file mode 100644
--- /dev/null
+++ b/tests/test_events/test_events_partners_integration.py
@@ -0,0 +1,105 @@
+import boto3
+import json
+import os
+
+from datetime import datetime
+from moto im... | 2023-03-20T09:41:54Z | [Ec2 Tags] ResourceType input removed from Tags and expected later on to be present
In file moto/ec2/responses/_base_response.py, method _parse_tag_specification converts the provided tags from:
```
[{"ResourceType": _type, "Tag": [{"Key": k, "Value": v}, ..]}]
```
To:
```
{_type: {k: v, ..}}
```
The same "_par... | python/mypy | cfd01d9f7fdceb5eb8e367e8f1a6a1efb5ede38c | 4.2 | [] | [
"tests/test_route53/test_route53_delegationsets.py::test_create_reusable_delegation_set",
"tests/test_route53/test_route53_delegationsets.py::test_create_reusable_delegation_set_from_hosted_zone_with_delegationsetid",
"tests/test_route53/test_route53_delegationsets.py::test_get_reusable_delegation_set_unknown",... |
getmoto__moto-5997 | This line might be the root cause:
https://github.com/python/typeshed/blob/59408d9c9cd1d25e4083707893a1b2f2965c2c0a/stdlib/typing_extensions.pyi#L72-L74
I will try to fix it.
Yes, this code fixes this issue:
```python
if sys.version_info >= (3, 8):
from typing import OrderedDict as OrderedDict
else:
... | diff --git a/mypy/stubgen.py b/mypy/stubgen.py
--- a/mypy/stubgen.py
+++ b/mypy/stubgen.py
@@ -633,6 +633,7 @@ def process_decorator(self, o: Decorator) -> None:
Only preserve certain special decorators such as @abstractmethod.
"""
+ o.func.is_overload = False
for decorator in o.orig... | diff --git a/tests/test_core/test_config.py b/tests/test_core/test_config.py
new file mode 100644
--- /dev/null
+++ b/tests/test_core/test_config.py
@@ -0,0 +1,52 @@
+import requests
+
+from moto import mock_aws, settings
+from moto.awslambda.models import LambdaBackend
+from moto.awslambda.utils import get_backend
+fr... | 2023-05-08 21:51:01 | Crash with slices e.g. `Annotated[int, 3:4]`
**Bug Report / To Reproduce / Actual Behavior**
This:
```python
# file.py
from typing import Annotated
def func(x: Annotated[int, 3:4]):
pass
# command line
mypy file.py
```
produces:
```
file.py:4: error: syntax error in type comment
Found 1 error in 1 ... | getmoto/moto | 3e6394e641f29110ed29deb2e9806e2f9cb7106f | 5.0 | [
"tests/test_ec2/test_ec2_cloudformation.py::test_classic_eip",
"tests/test_ec2/test_ec2_cloudformation.py::test_vpc_gateway_attachment_creation_should_attach_itself_to_vpc",
"tests/test_ec2/test_ec2_cloudformation.py::test_subnet_tags_through_cloudformation_boto3",
"tests/test_ec2/test_ec2_cloudformation.py::... | [
"tests/test_glue/test_datacatalog.py::test_get_databases",
"tests/test_glue/test_datacatalog.py::test_get_tables",
"tests/test_glue/test_datacatalog.py::test_get_table_versions"
] |
python__mypy-11151 | Thanks for raising this @SeanBickle. The instance-type-offerings are a direct dump from AWS - strange that they are using `1b` and `1c`, but not `1a`. Marking it as a bug to fix our hardcoded zones to also use `1b` and `1c` though. | diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py
--- a/moto/awslambda/models.py
+++ b/moto/awslambda/models.py
@@ -1310,7 +1310,14 @@ def publish_function(
if not self._functions[name]["latest"]:
return None
- new_version = len(self._functions[name]["versions"]) + 1
+ ... | diff --git a/tests/test_logs/test_integration.py b/tests/test_logs/test_integration.py
--- a/tests/test_logs/test_integration.py
+++ b/tests/test_logs/test_integration.py
@@ -10,6 +10,7 @@
from botocore.exceptions import ClientError
from datetime import datetime
from moto import mock_logs, mock_lambda, mock_iam, moc... | 2023-08-01 16:05:18 | elbv2.describe_listeners the results are not the same as those returned by AWS
Python Version: 3.6
Moto Version: 2.2.20dev15
When calling elbv2.describe_listeners the results for returned for DefaultActions and Rules are not the same as those returned by AWS.
example call
```
listener = client.elbv2.describe_l... | getmoto/moto | ca5d514c61d74b7278ad9c3a035d179f54ed0b92 | 4.2 | [
"tests/test_core/test_auth.py::test_s3_access_denied_with_denying_attached_group_policy",
"tests/test_core/test_auth.py::test_allowed_with_wildcard_action",
"tests/test_core/test_auth.py::test_access_denied_for_run_instances",
"tests/test_core/test_auth.py::test_access_denied_with_no_policy",
"tests/test_co... | [
"tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_batch_put_item_with_empty_value"
] |
python__mypy-13015 | Hi @davidaah, thanks for raising this - will mark it as an enhancement.
If you want to contribute this to Moto, PR's are always welcome! | diff --git a/moto/secretsmanager/models.py b/moto/secretsmanager/models.py
--- a/moto/secretsmanager/models.py
+++ b/moto/secretsmanager/models.py
@@ -180,6 +180,10 @@ def __contains__(self, key):
new_key = get_secret_name_from_arn(key)
return dict.__contains__(self, new_key)
+ def get(self, key,... | diff --git a/tests/test_rds/test_rds_clusters.py b/tests/test_rds/test_rds_clusters.py
--- a/tests/test_rds/test_rds_clusters.py
+++ b/tests/test_rds/test_rds_clusters.py
@@ -15,6 +15,19 @@ def test_describe_db_cluster_initial():
resp.should.have.key("DBClusters").should.have.length_of(0)
+@mock_rds
+def test_... | 2023-04-25 13:07:57 | The filter 'route.gateway-id' for DescribeRouteTables has not been implemented in Moto yet.
Would you consider adding support for route.gateway-id filter in the DescribeRouteTables command?
| getmoto/moto | ac6dc18545c9eafbf576e1151f7f698ec1f1b256 | 1.5 | [
"tests/test_sagemaker/test_sagemaker_training.py::test_list_training_jobs_paginated_with_fragmented_targets",
"tests/test_sagemaker/test_sagemaker_training.py::test_list_training_jobs_none",
"tests/test_sagemaker/test_sagemaker_training.py::test_list_training_jobs_multiple",
"tests/test_sagemaker/test_sagemak... | [
"mypy/test/testcheck.py::TypeCheckSuite::testFinalEnumWithClassDef",
"mypy/test/testcheck.py::TypeCheckSuite::testEnumImplicitlyFinalForSubclassing",
"mypy/test/testcheck.py::TypeCheckSuite::testEnumFinalSubtypingMethodAndValueSpecialCase"
] |
getmoto__moto-7144 | Thanks for raising this @1oglop1 - will mark it as an enhancement to implement this validation. | diff --git a/moto/ec2/models/amis.py b/moto/ec2/models/amis.py
--- a/moto/ec2/models/amis.py
+++ b/moto/ec2/models/amis.py
@@ -101,11 +101,10 @@ def __init__( # pylint: disable=dangerous-default-value
if not description:
self.description = source_ami.description
- self.launch_per... | diff --git a/tests/test_s3/test_s3_object_attributes.py b/tests/test_s3/test_s3_object_attributes.py
new file mode 100644
--- /dev/null
+++ b/tests/test_s3/test_s3_object_attributes.py
@@ -0,0 +1,113 @@
+import boto3
+import pytest
+from moto import mock_s3
+from uuid import uuid4
+
+
+@mock_s3
+class TestS3ObjectAttri... | 2023-02-11T15:08:11Z | More crashes in class scoped imports
In Python 3 (but not Python 2), it is illegal to do `import *` in class body, but mypy allows it.
It also crashes if you do `class X: from os import *`:
```
% python -m mypy -c 'class Capybara: from os import *' --show-traceback
<string>:1: error: INTERNAL ERROR -- Please tr... | getmoto/moto | 2c3f735e8539a401bc474043a37df247140ed295 | 3.1 | [
"tests/test_ssm/test_ssm_maintenance_windows.py::test_get_maintenance_windows",
"tests/test_ssm/test_ssm_maintenance_windows.py::test_describe_maintenance_windows",
"tests/test_ssm/test_ssm_maintenance_windows.py::test_delete_maintenance_windows",
"tests/test_ssm/test_ssm_maintenance_windows.py::test_create_m... | [
"mypy/test/testfinegrainedcache.py::FineGrainedCacheSuite::testNestedClassMethodSignatureChanges_cached",
"mypy/test/testcheck.py::TypeCheckSuite::testForwardReferenceToDynamicallyTypedClassMethod",
"mypy/test/testfinegrainedcache.py::FineGrainedCacheSuite::testImportStarPropagateChange2_cached",
"mypy/test/t... |
getmoto__moto-5202 | I found the origin of this bug and a way to fix it, but I need more type to write a proper test (I would appreciate if someone experienced pointed me to a place where this test should be placed)
```
--- a/mypy/subtypes.py
+++ b/mypy/subtypes.py
@@ -710,7 +710,7 @@ def find_node_type(node: Union[Var, FuncBase], ityp... | diff --git a/moto/cognitoidp/models.py b/moto/cognitoidp/models.py
--- a/moto/cognitoidp/models.py
+++ b/moto/cognitoidp/models.py
@@ -443,6 +443,21 @@ def __init__(self, region, name, extended_config):
) as f:
self.json_web_key = json.loads(f.read())
+ @property
+ def backend(self):
+ ... | diff --git a/test-data/unit/check-namedtuple.test b/test-data/unit/check-namedtuple.test
--- a/test-data/unit/check-namedtuple.test
+++ b/test-data/unit/check-namedtuple.test
@@ -1081,3 +1081,42 @@ t: T
y: List[T] = [t]
[builtins fixtures/tuple.pyi]
[typing fixtures/typing-namedtuple.pyi]
+
+[case testNamedTupleWith... | 2022-11-22T05:28:48Z | list_targets_by_rule method - EventBusName parameter is not included
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/events/client/list_targets_by_rule.html contains EventBusName parameter which is not included in the moto.
As a result, when the method is called for rules with the same names... | getmoto/moto | 181cbe88f1396f2f52770f59b6bbb13c6521980a | 0.920 | [] | [
"tests/test_kms/test_kms_boto3.py::test_list_aliases_for_key_arn",
"tests/test_kms/test_kms_boto3.py::test_list_aliases_for_key_id"
] |
python__mypy-14981 | Hi @tekumara, thanks for raising this! We refactored our EC2 backend a bit, but we didn't have a test for this specific scenario, so we didn't know that was broken. Will push a fix shortly. | diff --git a/moto/dynamodb/exceptions.py b/moto/dynamodb/exceptions.py
--- a/moto/dynamodb/exceptions.py
+++ b/moto/dynamodb/exceptions.py
@@ -332,3 +332,8 @@ class TransactWriteSingleOpException(MockValidationException):
def __init__(self):
super().__init__(self.there_can_be_only_one)
+
+
+class Serial... | diff --git a/test-data/unit/check-recursive-types.test b/test-data/unit/check-recursive-types.test
--- a/test-data/unit/check-recursive-types.test
+++ b/test-data/unit/check-recursive-types.test
@@ -808,3 +808,21 @@ def test2() -> Tree2:
def test3() -> Tree3:
return 42 # E: Incompatible return value type (got "i... | 2023-02-10 22:48:01 | Reachability/exhaustiveness checking for match statements
Currently this generates a false positive, since mypy doesn't recognize that all the possible values are processed by the match statement:
```py
# Error: Missing return statement
def f(x: int | str) -> int:
match x:
case str(v):
ret... | getmoto/moto | 7d031beb017450ac990c97e288d064290e3be55f | 4.2 | [
"mypy/test/testcheck.py::TypeCheckSuite::testDictMissingFromStubs",
"mypy/test/testcheck.py::TypeCheckSuite::testReExportAllInStub"
] | [
"mypy/test/testcheck.py::TypeCheckSuite::check-assert-type-fail.test::testAssertTypeFail1",
"mypy/test/testcheck.py::TypeCheckSuite::check-assert-type-fail.test::testAssertTypeFail2"
] |
getmoto__moto-6439 | Thanks for raising this, @cheshirex. Do you use the `LaunchTemplateConfigs.Overrides` parameter at all, or would just support for `LaunchTemplateConfigs.LaunchTemplateSpecification` be sufficient for your use case?
I do use the overrides.
Thanks!
I found the same problem, also with using `LaunchTemplateConfigs.Overr... | diff --git a/moto/cognitoidp/models.py b/moto/cognitoidp/models.py
--- a/moto/cognitoidp/models.py
+++ b/moto/cognitoidp/models.py
@@ -539,7 +539,7 @@ def create_jwt(
"token_use": token_use,
"auth_time": now,
"exp": now + expires_in,
- "username": username,
+ ... | diff --git a/tests/test_awslambda/test_lambda.py b/tests/test_awslambda/test_lambda.py
--- a/tests/test_awslambda/test_lambda.py
+++ b/tests/test_awslambda/test_lambda.py
@@ -1428,6 +1428,62 @@ def test_update_function_s3():
assert config["LastUpdateStatus"] == "Successful"
+@mock_lambda
+def test_update_funct... | 2022-02-11 20:45:57 | CORS rules not being applied to PUT responses
Hello! I'm the author of [this issue](https://github.com/getmoto/moto/issues/4220) which was solved on [this PR](https://github.com/getmoto/moto/pull/4497). So first off I'd like to thank you for looking into it.
Some time has passed but only now we've been able to updat... | getmoto/moto | e4c0d0618c586ffb6eb5d8c9f2c8437f57eacebc | 0.920 | [] | [
"mypy/test/testcheck.py::TypeCheckSuite::check-inference.test::testForStatementInferenceWithVoid",
"mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testConditionalExpressionWithEmptyCondition",
"mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNoneReturnTypeWithExpressions",
... |
getmoto__moto-7348 | Thanks for raising this @jvuori. I don't expect anyone to rely on those specific values, so I'm happy to change them to adhere to AWS' guidelines. | diff --git a/moto/kms/models.py b/moto/kms/models.py
--- a/moto/kms/models.py
+++ b/moto/kms/models.py
@@ -629,9 +629,8 @@ def __ensure_valid_key_spec(self, key_spec: str) -> None:
def sign(
self, key_id: str, message: bytes, signing_algorithm: str
) -> Tuple[str, bytes, str]:
- """Sign messag... | diff --git a/mypy/test/helpers.py b/mypy/test/helpers.py
--- a/mypy/test/helpers.py
+++ b/mypy/test/helpers.py
@@ -241,7 +241,9 @@ def num_skipped_suffix_lines(a1: list[str], a2: list[str]) -> int:
def testfile_pyversion(path: str) -> tuple[int, int]:
- if path.endswith("python311.test"):
+ if path.endswith(... | 2022-09-09 21:39:28 | Feature Request: Implementation for `CancelRotateSecret` is missing for secretsmanager
Currently the `secretsmanager` component is missing implementation for a few endpoints, `CancelRotateSecret` is one of them. I use this library extensivley and just recently came accross the requirement for this feature, happy to tak... | getmoto/moto | e6818c3f1d3e8f552e5de736f68029b4efd1994f | 0.820 | [
"tests/test_ec2/test_spot_fleet.py::test_modify_spot_fleet_request_up",
"tests/test_ec2/test_spot_fleet.py::test_modify_spot_fleet_request_down",
"tests/test_ec2/test_spot_fleet.py::test_modify_spot_fleet_request_down_no_terminate_after_custom_terminate",
"tests/test_ec2/test_spot_fleet.py::test_request_spot_... | [
"tests/test_s3/test_s3_object_attributes.py::TestS3ObjectAttributes::test_get_attributes_storageclass",
"tests/test_s3/test_s3_object_attributes.py::TestS3ObjectAttributes::test_get_attributes_checksum[algo_val1]",
"tests/test_s3/test_s3_object_attributes.py::TestS3ObjectAttributes::test_get_attributes_multiple... |
getmoto__moto-7061 | Ah, I see on https://github.com/spulec/moto/blob/1.3.16/IMPLEMENTATION_COVERAGE.md#cloudformation that `list_stack_instances` is unimplemented
Hey @jbpratt, thanks for raising this.
All operations that you need are implemented - it looks like the coverage doc is simply not up to date.
The first issue here is that t... | diff --git a/mypy/checker.py b/mypy/checker.py
--- a/mypy/checker.py
+++ b/mypy/checker.py
@@ -5232,6 +5232,15 @@ def _make_fake_typeinfo_and_full_name(
pretty_names_list = pretty_seq(
format_type_distinctly(*base_classes, options=self.options, bare=True), "and"
)
+
+ new_errors = ... | diff --git a/test-data/unit/check-narrowing.test b/test-data/unit/check-narrowing.test
--- a/test-data/unit/check-narrowing.test
+++ b/test-data/unit/check-narrowing.test
@@ -1073,3 +1073,23 @@ def f(t: Type[C]) -> None:
else:
reveal_type(t) # N: Revealed type is "Type[__main__.C]"
reveal_type(t) #... | 2021-12-29T18:04:40Z | Stepfunction describe executions returns a double encoded string
## Issue
When running describe_execution as follows, the result is a string not the expected dictionary
``` python
@mock_aws
def test_a(self):
client = boto3.client("stepfunctions")
sf = client.create_state_machine(
name="name",... | python/mypy | 3d205764fff2ca792886d84d0a16791dfd33f077 | 4.1 | [
"tests/test_ec2/test_route_tables.py::test_route_table_associations",
"tests/test_ec2/test_route_tables.py::test_route_tables_defaults",
"tests/test_ec2/test_route_tables.py::test_route_tables_filters_standard",
"tests/test_ec2/test_route_tables.py::test_routes_vpn_gateway",
"tests/test_ec2/test_route_table... | [
"tests/test_s3/test_s3_file_handles.py::TestS3FileHandleClosures::test_reset_other_backend"
] |
getmoto__moto-6567 | Hi @v-rosa, thanks for raising this - marking it as an enhancement to create these alarms. | diff --git a/mypy/typeops.py b/mypy/typeops.py
--- a/mypy/typeops.py
+++ b/mypy/typeops.py
@@ -71,13 +71,13 @@ def is_recursive_pair(s: Type, t: Type) -> bool:
"""
if isinstance(s, TypeAliasType) and s.is_recursive:
return (
- isinstance(get_proper_type(t), Instance)
+ isinstanc... | diff --git a/test-data/unit/check-enum.test b/test-data/unit/check-enum.test
--- a/test-data/unit/check-enum.test
+++ b/test-data/unit/check-enum.test
@@ -1360,3 +1360,34 @@ class E(IntEnum):
A = N(0)
reveal_type(E.A.value) # N: Revealed type is "__main__.N"
+
+
+[case testEnumReusedKeys]
+# https://github.com/... | 2022-04-06 21:11:43 | mypyc: `Cls.__dict__` is `mappingproxy`, not `dict`
**Bug Report**
It looks mypy's type inference works fine and it's mypyc (maybe) bug
Maybe it's connected to builtins `vars` signature -- vars by the signature should return `dict`
But it's false, `vars` may return `mappingproxy`:
```
>>> class Foo:
...
>>> F... | getmoto/moto | 652eabda5170e772742d4a68234a26fa8765e6a9 | 4.1 | [
"tests/test_dynamodb/test_dynamodb.py::test_remove_list_index__remove_existing_nested_index",
"tests/test_dynamodb/test_dynamodb.py::test_basic_projection_expressions_using_query_with_attr_expression_names",
"tests/test_dynamodb/test_dynamodb_table_with_range_key.py::test_update_item_delete_with_expression",
... | [
"tests/test_s3/test_s3_multipart.py::test_generate_presigned_url_on_multipart_upload_without_acl"
] |
getmoto__moto-6306 | Actually, it suffices to put a `def` with a type hint in the class for mypy to crash. This code also make mypy crash:
```python
from typing import Any, TypedDict
class D(TypeDict):
def x(self, key: int):
pass
```
Thanks a lot for the report!
Yes, I can reproduce it on the latest `master`. I thing ... | diff --git a/mypy/erasetype.py b/mypy/erasetype.py
--- a/mypy/erasetype.py
+++ b/mypy/erasetype.py
@@ -1,10 +1,10 @@
-from typing import Optional, Container, Callable
+from typing import Optional, Container, Callable, List, Dict, cast
from mypy.types import (
Type, TypeVisitor, UnboundType, AnyType, NoneType, T... | diff --git a/test-data/unit/check-dataclasses.test b/test-data/unit/check-dataclasses.test
--- a/test-data/unit/check-dataclasses.test
+++ b/test-data/unit/check-dataclasses.test
@@ -1456,3 +1456,69 @@ class Other:
__slots__ = ('x',)
x: int
[builtins fixtures/dataclasses.pyi]
+
+
+[case testSlotsDefinitionWi... | 2022-08-31 18:51:06 | Expose logic of get_amis.py in moto as a test.utils.something
Would you guys be opposed to making this code
https://github.com/spulec/moto/blob/871591f7f17458c10ce039d6e2f36abe3430fec5/scripts/get_amis.py#L47-L65
a utility function somewhere in moto so that users who want/need to create their own MOTO_AMIS_PATH c... | getmoto/moto | d7b24514d7301f86031b7d1e2215cf8c2476bec0 | 3.1 | [
"tests/test_ec2/test_vpcs.py::test_creating_a_vpc_in_empty_region_does_not_make_this_vpc_the_default",
"tests/test_ec2/test_vpcs.py::test_create_vpc_with_invalid_cidr_block_parameter",
"tests/test_ec2/test_vpcs.py::test_vpc_dedicated_tenancy",
"tests/test_ec2/test_vpcs.py::test_vpc_state_available_filter",
... | [
"mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testCachedProperty",
"mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testFunctoolsCachedPropertyAlias",
"mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testCachedPropertyAlias",
"mypy/test/teststubgen.py::StubgenPythonSuite... |
python__mypy-15133 | Having the same issue on my code, I really don't understand where and why, can someone shed some light?
mentioned in alembics repo: https://github.com/sqlalchemy/alembic/issues/897
I've tried to debug this a bit on alembic side: https://github.com/sqlalchemy/alembic/issues/897#issuecomment-913855198
It seems a cir... | diff --git a/mypy/server/update.py b/mypy/server/update.py
--- a/mypy/server/update.py
+++ b/mypy/server/update.py
@@ -232,15 +232,17 @@ def update(self,
self.manager.log_fine_grained('previous targets with errors: %s' %
sorted(self.previous_targets_with_errors))
+ bl... | diff --git a/tests/test_applicationautoscaling/__init__.py b/tests/test_applicationautoscaling/__init__.py
--- a/tests/test_applicationautoscaling/__init__.py
+++ b/tests/test_applicationautoscaling/__init__.py
@@ -0,0 +1,71 @@
+import os
+from functools import wraps
+
+import boto3
+
+from moto import mock_aws
+from t... | 2023-01-15 22:02:00 | Invalid instance ID error behaves differently from AWS
https://github.com/spulec/moto/blob/ea81377cd0ce669dbb01d2141ef6f7e92c9b757d/moto/ec2/exceptions.py#L238
When I terminate more than one non-existent ID in AWS, I get the error:
An error occurred (InvalidInstanceID.NotFound) when calling the TerminateInstances o... | python/mypy | 28d57b13ab5ea765728bde534eda2877f8d92b4b | 4.1 | [
"tests/test_eks/test_server.py::test_eks_create_multiple_clusters_with_same_name",
"tests/test_eks/test_server.py::test_eks_delete_cluster",
"tests/test_eks/test_server.py::test_eks_list_nodegroups",
"tests/test_eks/test_server.py::test_eks_delete_nonexisting_cluster",
"tests/test_eks/test_server.py::test_e... | [
"tests/test_resourcegroupstaggingapi/test_resourcegroupstagging_logs.py::TestLogsTagging::test_tag_resources_logs",
"tests/test_resourcegroupstaggingapi/test_resourcegroupstagging_logs.py::TestLogsTagging::test_get_resources_logs",
"tests/test_logs/test_logs_tags.py::test_log_groups_tags",
"tests/test_logs/te... |
getmoto__moto-6585 | It seems that version 0.750 still have this bug. Do you have any ideas how to solve it?
~~`py-evm` uses [this workaround](https://github.com/ethereum/py-evm/pull/1885/commits/0d79bb6c56f4835ef9242cbad18a51ef86e77011) for now.~~
Here's a link that works to the py-evm workaround:
https://github.com/ethereum/py-evm/blo... | diff --git a/mypy/stubgen.py b/mypy/stubgen.py
--- a/mypy/stubgen.py
+++ b/mypy/stubgen.py
@@ -22,7 +22,7 @@
=> Generate out/urllib/parse.pyi.
$ stubgen -p urllib
- => Generate stubs for whole urlib package (recursively).
+ => Generate stubs for whole urllib package (recursively).
For C modules, you can ge... | diff --git a/tests/test_s3/test_s3_copyobject.py b/tests/test_s3/test_s3_copyobject.py
--- a/tests/test_s3/test_s3_copyobject.py
+++ b/tests/test_s3/test_s3_copyobject.py
@@ -68,6 +68,18 @@ def test_copy_key_boto3_with_sha256_checksum():
assert "ChecksumSHA256" in resp["Checksum"]
assert resp["Checksum"]["Che... | 2022-01-25T10:52:30Z | When using a NONEXISTENT_REGION, `get_id` of `mock_cognitoidentity` fails
When using a NONEXISTENT_REGION, `get_id` of `mock_cognitoidentity` fails because the request made by `botocore` does not contain the `Authorization header`
I have tried this with `python>=3.8`
Here it follows an example `get_id` request:
... | python/mypy | e7156a76422de82342b4673d217004f384f427ed | 5.0 | [
"tests/test_secretsmanager/test_secretsmanager.py::test_get_secret_that_has_no_value",
"tests/test_secretsmanager/test_secretsmanager.py::test_get_secret_value_by_arn",
"tests/test_secretsmanager/test_secretsmanager.py::test_update_secret_with_KmsKeyId",
"tests/test_secretsmanager/test_secretsmanager.py::test... | [
"tests/test_s3/test_s3_copyobject.py::test_copy_key_boto3_with_sha256_checksum"
] |
getmoto__moto-5575 | Hi @jplauri! That's just an oversight, as far as I can tell - marking it as a bug. | diff --git a/moto/dynamodb/models/table.py b/moto/dynamodb/models/table.py
--- a/moto/dynamodb/models/table.py
+++ b/moto/dynamodb/models/table.py
@@ -843,6 +843,12 @@ def scan(
if passes_all_conditions:
results.append(item)
+ results = copy.deepcopy(results)
+ if index_nam... | diff --git a/tests/test_dynamodb/test_dynamodb_update_expressions.py b/tests/test_dynamodb/test_dynamodb_update_expressions.py
--- a/tests/test_dynamodb/test_dynamodb_update_expressions.py
+++ b/tests/test_dynamodb/test_dynamodb_update_expressions.py
@@ -1,3 +1,5 @@
+from decimal import Decimal
+
import boto3
import ... | 2023-03-21 21:00:55 | Lambda KeyError: 'Handler'
# Background
The following works in "real" AWS, but throws an error when using moto.
I expect this to just pass and the lambda be created, but instead an exception is thrown:
```python
from moto import mock_lambda
import boto3
@mock_lambda
def make_lambda():
lambda_client = bo... | getmoto/moto | 4ec748542f91c727147390685adf641a29a4e9e4 | 1.7 | [
"mypy/test/testdaemon.py::DaemonSuite::daemon.test::testDaemonRunRestartPretty",
"mypy/test/testdaemon.py::DaemonSuite::daemon.test::testDaemonRunRestart",
"mypy/test/testdaemon.py::DaemonSuite::daemon.test::testDaemonRunRestartGlobs",
"mypy/test/testdaemon.py::DaemonSuite::daemon.test::testDaemonRunRestartPl... | [
"mypy/test/testcheck.py::TypeCheckSuite::testNarrowingTypedDictUsingEnumLiteral"
] |
getmoto__moto-6085 | Thanks for raising this @jluevan13 - looks like the `us-east-1`-region is hardcoded for some reason. Marking it as a bug.
https://github.com/spulec/moto/blob/ecc0da7e8782b59d75de668b95c4b498a5ef8597/moto/dynamodb/models/__init__.py#L569
| diff --git a/mypy/nodes.py b/mypy/nodes.py
--- a/mypy/nodes.py
+++ b/mypy/nodes.py
@@ -3083,7 +3083,7 @@ def protocol_members(self) -> list[str]:
for base in self.mro[:-1]: # we skip "object" since everyone implements it
if base.is_protocol:
for name, node in base.names.items():
... | diff --git a/tests/test_dynamodb/test_dynamodb.py b/tests/test_dynamodb/test_dynamodb.py
--- a/tests/test_dynamodb/test_dynamodb.py
+++ b/tests/test_dynamodb/test_dynamodb.py
@@ -1386,6 +1386,25 @@ def test_query_filter():
)
assert response["Count"] == 2
+ # Combine Limit + Scan
+ response = table.que... | 2023-06-15T22:15:09Z | Class __init__ "Too few arguments" should be a better error message
Note: if you are reporting a wrong signature of a function or a class in
the standard library, then the typeshed tracker is better suited
for this report: https://github.com/python/typeshed/issues
Please provide more information to help us underst... | getmoto/moto | 2522bc495d71603fb6d38c41a34e6e9b122f27a1 | 1.4 | [
"tests/test_secretsmanager/test_secretsmanager.py::test_get_secret_that_has_no_value",
"tests/test_secretsmanager/test_secretsmanager.py::test_get_secret_value_by_arn",
"tests/test_secretsmanager/test_secretsmanager.py::test_update_secret_with_KmsKeyId",
"tests/test_secretsmanager/test_secretsmanager.py::test... | [
"tests/test_sns/test_publishing_boto3.py::test_publish_to_http",
"tests/test_sns/test_topics_boto3.py::test_topic_attributes"
] |
getmoto__moto-5386 | Thanks for raising this @joemulray - marking it as an enhancement to add this field. | diff --git a/moto/dynamodb2/exceptions.py b/moto/dynamodb2/exceptions.py
--- a/moto/dynamodb2/exceptions.py
+++ b/moto/dynamodb2/exceptions.py
@@ -205,6 +205,13 @@ def __init__(self):
super().__init__(self.msg)
+class TooManyTransactionsException(MockValidationException):
+ msg = "Validation error at tr... | diff --git a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
--- a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
+++ b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
@@ -899,3 +899,43 @@ def test_put_item__string_as_integer... | 2021-05-04T15:39:03Z | tagged union of unions
**Report Type:** Bug
**Example:** https://mypy-play.net/?mypy=latest&python=3.8&gist=529e99849ebe65749d8568b743f21050
I saw https://github.com/python/mypy/issues/8925.
It could be seen as a duplicate, not sure about it, but this one looks slightly different and more general as the one li... | python/mypy | a79f1aaade9fe150a4bc9bb1d5ad287824298f74 | 4.2 | [] | [
"tests/test_awslambda/test_lambda.py::test_list_functions",
"tests/test_awslambda/test_lambda.py::test_list_create_list_get_delete_list",
"tests/test_awslambda/test_lambda.py::test_create_function_from_zipfile"
] |
getmoto__moto-4915 | I have interest in getting WAF(v2) support and started an issue here: https://github.com/spulec/moto/issues/3971 | diff --git a/moto/core/responses.py b/moto/core/responses.py
--- a/moto/core/responses.py
+++ b/moto/core/responses.py
@@ -14,6 +14,7 @@
from moto.core.exceptions import DryRunClientError
from moto.core.utils import (
camelcase_to_underscores,
+ gzip_decompress,
method_names_from_class,
params_sort_... | diff --git a/tests/test_ecr/test_ecr_scanning_config.py b/tests/test_ecr/test_ecr_scanning_config.py
new file mode 100644
--- /dev/null
+++ b/tests/test_ecr/test_ecr_scanning_config.py
@@ -0,0 +1,140 @@
+import boto3
+from moto import mock_ecr
+
+
+@mock_ecr
+def test_batch_get_repository_scanning_configuration():
+ ... | 2024-03-03 12:17:20 | BUG: stubgen from class does not inheritd namedtuple
stubgen:
```
class AuditContext(collections.namedtuple('AuditContext', ['user_id', 'ip'])):
def from_request(cls, request):
pass # somecode
```
generated as pyi:
```
class AuditContext:
@classmethod
def from_request(cls, request): ...
```
... | python/mypy | 3545d38595e91a94a38d88661cd314172cb48bef | 4.2 | [] | [
"tests/test_cognitoidp/test_server.py::test_sign_up_method_without_authentication"
] |
getmoto__moto-6127 | Hi @AngeloGC, happy to hear that Moto is useful for you!
Marking it as an enhancement to support this. | diff --git a/moto/secretsmanager/models.py b/moto/secretsmanager/models.py
--- a/moto/secretsmanager/models.py
+++ b/moto/secretsmanager/models.py
@@ -229,6 +229,29 @@ def _from_client_request_token(self, client_request_token):
version_id = str(mock_random.uuid4())
return version_id
+ def can... | diff --git a/test-data/unit/check-selftype.test b/test-data/unit/check-selftype.test
--- a/test-data/unit/check-selftype.test
+++ b/test-data/unit/check-selftype.test
@@ -802,6 +802,37 @@ class Bad(metaclass=Meta):
Good.do_x()
Bad.do_x() # E: Invalid self argument "Type[Bad]" to attribute function "do_x" with type "... | 2023-05-12 10:07:35 | regression: type alias for `NoReturn` no longer works as a type annotation
this worked in 0.921
```py
from typing import NoReturn
Never = NoReturn
a: Never # error: Variable "__main__.Never" is not valid as a type [valid-type]
b: NoReturn # no error
```
https://mypy-play.net/?mypy=0.930&python=3.10&flags=... | python/mypy | 090a414ba022f600bd65e7611fa3691903fd5a74 | 4.1 | [
"tests/test_cloudfront/test_cloudfront.py::test_update_distribution_distId_is_None",
"tests/test_cloudfront/test_cloudfront.py::test_update_distribution",
"tests/test_cloudfront/test_cloudfront.py::test_update_distribution_no_such_distId",
"tests/test_cloudfront/test_cloudfront.py::test_update_distribution_If... | [
"mypy/test/testcheck.py::TypeCheckSuite::testEnumFinalValuesCannotRedefineValueProp",
"mypy/test/testcheck.py::TypeCheckSuite::testEnumValueExtraMethods",
"mypy/test/testcheck.py::TypeCheckSuite::testEnumValueExtended",
"mypy/test/testcheck.py::TypeCheckSuite::testEnumFinalValues"
] |
getmoto__moto-5843 | Hi @LVSant, thanks for raising this.
The `connectivity`-data is calculated by AWS, I assume? So there is no good way to emulate that - we will just have to hardcode this part of the response, and assume/pretend devices are always connected. | diff --git a/moto/acm/models.py b/moto/acm/models.py
--- a/moto/acm/models.py
+++ b/moto/acm/models.py
@@ -367,17 +367,36 @@ def describe(self):
"KeyAlgorithm": key_algo,
"NotAfter": datetime_to_epoch(self._cert.not_valid_after),
"NotBefore": datetime_to_epoch(self._ce... | diff --git a/test-data/unit/check-typevar-tuple.test b/test-data/unit/check-typevar-tuple.test
--- a/test-data/unit/check-typevar-tuple.test
+++ b/test-data/unit/check-typevar-tuple.test
@@ -570,3 +570,237 @@ call(A().func3, 0, 1, 2)
call(A().func3)
[builtins fixtures/tuple.pyi]
+
+[case testVariadicAliasBasicTuple... | 2022-09-19 20:30:59 | Logs: create_export_task() currently does not export any data to S3
Two reasons:
- the `filter_log_events` does not check any streams (as it passes an empty list)
- the date filtering is wrong, where we pass seconds and compare them to milliseconds (or vice versa..)
We should have an AWS-compatible test to veri... | getmoto/moto | f7ba430c0323e0725ec5f63ae1746d49c3f574d0 | 3.1 | [
"mypy/test/testpep561.py::PEP561Suite::pep561.test::testTypedPkgSimplePackageSearchPath",
"mypy/test/testpep561.py::PEP561Suite::pep561.test::testTypedPkgNamespaceImportFrom",
"mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadVarargsAndKwargsSelection",
"mypy/test/testcheck.py::Type... | [
"mypy/test/testcheck.py::TypeCheckSuite::testIncrementalNestedTypeAlias"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.