@@ -1451,6 +1451,8 @@ def test_creating_subscription(self, sns_create_topic, aws_client, snapshot):
14511451 resp = aws_client .sns .subscribe (
14521452 TopicArn = topic_arn , Protocol = "http" , Endpoint = "http://example.com/"
14531453 )
1454+ # TODO: investigate why it leaves the subscription in `SNS.ListSubscriptions`, we maybe need to clean up
1455+ # after deleting topics, not fully in parity as AWS cleans up instantly
14541456 snapshot .match ("create-subscription" , resp )
14551457
14561458 # TODO: parametrize for email protocol
@@ -4017,6 +4019,7 @@ def test_delete_platform_endpoint_with_subscription(
40174019
40184020 app_name = f"platform-application-{ short_uid ()} "
40194021 snapshot .add_transformer (RegexTransformer (app_name , "<platform_application>" ))
4022+ snapshot .add_transformer (snapshot .transform .key_value ("NextToken" ))
40204023 # if tested against AWS, the fixture needs to contain real credentials
40214024 principal , credential = platform_credentials
40224025 attributes = {"PlatformPrincipal" : principal , "PlatformCredential" : credential }
@@ -4033,7 +4036,8 @@ def test_delete_platform_endpoint_with_subscription(
40334036 if is_aws_cloud ():
40344037 time .sleep (20 )
40354038
4036- response = aws_client .sns .list_subscriptions ()
4039+ # we list subscriptions by topic, as some tests are not cleaning up properly
4040+ response = aws_client .sns .list_subscriptions_by_topic (TopicArn = topic_arn )
40374041 snapshot .match ("list-subscriptions-pre-delete" , response )
40384042
40394043 response = aws_client .sns .delete_endpoint (EndpointArn = endpoint_arn )
@@ -4043,7 +4047,7 @@ def test_delete_platform_endpoint_with_subscription(
40434047 if is_aws_cloud ():
40444048 time .sleep (20 )
40454049
4046- response = aws_client .sns .list_subscriptions ( )
4050+ response = aws_client .sns .list_subscriptions_by_topic ( TopicArn = topic_arn )
40474051 snapshot .match ("list-subscriptions-post-delete" , response )
40484052
40494053 @markers .aws .manual_setup_required
0 commit comments