10000 skipif instead of xfail · localstack/localstack@bd84478 · GitHub
[go: up one dir, main page]

Skip to content

Commit bd84478

Browse files
committed
skipif instead of xfail
1 parent ef8ffe1 commit bd84478

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

tests/aws/services/resource_groups/test_resource_groups.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ def test_create_group(self, aws_client, resourcegroups_create_group, snapshot):
124124
assert 0 == len(response["Groups"])
125125

126126
@markers.aws.validated
127-
@pytest.mark.xfail(reason="Not implemented in moto (ListGroupResources)")
127+
@pytest.mark.skipif(
128+
condition=not is_aws_cloud(), reason="Not implemented in moto (ListGroupResources)"
129+
)
128130
def test_resource_groups_tag_query(
129131
self, aws_client, snapshot, resourcegroups_create_group, s3_bucket, sqs_create_queue
130132
):
@@ -185,7 +187,9 @@ def _get_group_resources():
185187
snapshot.match("list-group-resources-after-queue-removal", response)
186188

187189
@markers.aws.validated
188-
@pytest.mark.xfail(reason="Not implemented in moto (ListGroupResources)")
190+
@pytest.mark.skipif(
191+
condition=not is_aws_cloud(), reason="Not implemented in moto (ListGroupResources)"
192+
)
189193
def test_resource_groups_different_region(
190194
self, aws_client_factory, snapshot, resourcegroups_create_group, sqs_create_queue_in_region
191195
):
@@ -225,7 +229,9 @@ def test_resource_groups_different_region(
225229
snapshot.match("list-group-resources", response)
226230

227231
@markers.aws.validated
228-
@pytest.mark.xfail(reason="Not implemented in moto (ListGroupResources)")
232+
@pytest.mark.skipif(
233+
condition=not is_aws_cloud(), reason="Not implemented in moto (ListGroupResources)"
234+
)
229235
def test_resource_type_filters(
230236
self, aws_client, snapshot, resourcegroups_create_group, s3_bucket, sqs_create_queue
231237
):
@@ -264,11 +270,18 @@ def test_resource_type_filters(
264270
snapshot.match("list-group-resources", response)
265271

266272
@markers.aws.validated
267-
@pytest.mark.xfail(reason="Not implemented in moto (ListGroupResources)")
273+
@pytest.mark.skipif(
274+
condition=not is_aws_cloud(), reason="Not implemented in moto (ListGroupResources)"
275+
)
268276
def test_cloudformation_query(
269277
self, aws_client, deploy_cfn_template, snapshot, resourcegroups_create_group
270278
):
271-
snapshot.add_transformer(snapshot.transform.key_value("StackIdentifier"))
279+
snapshot.add_transformers_list(
280+
[
281+
snapshot.transform.key_value("StackIdentifier"),
282+
snapshot.transform.resource_name(),
283+
]
284+
)
272285
stack = deploy_cfn_template(
273286
template_path=os.path.join(
274287
os.path.dirname(__file__), "../../templates/deploy_template_2.yaml"
@@ -278,7 +291,6 @@ def test_cloudformation_query(
278291
assert len(stack.outputs) == 3
279292
topic_arn = stack.outputs["MyTopic"]
280293

281-
snapshot.add_transformer(snapshot.transform.resource_name())
282294
group_name = f"resource_group-{short_uid()}"
283295
response = resourcegroups_create_group(
284296
Name=group_name,
@@ -324,8 +336,11 @@ def test_cloudformation_query(
324336
snapshot.match("create-group-with-delete-stack", e.value.response)
325337

326338
@markers.aws.validated
327-
@pytest.mark.xfail(reason="Not implemented in moto (ListGroupResources)")
339+
@pytest.mark.skipif(
340+
condition=not is_aws_cloud(), reason="Not implemented in moto (SearchResources)"
341+
)
328342
def test_search_resources(self, aws_client, sqs_create_queue, snapshot):
343+
snapshot.add_transformer(snapshot.transform.resource_name())
329344
# create SQS queue with tags
330345
queue_url = sqs_create_queue(tags={"Stage": "test-resource-group"})
331346
queue_tags = aws_client.sqs.list_queue_tags(QueueUrl=queue_url)

tests/aws/services/resource_groups/test_resource_groups.snapshot.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@
374374
}
375375
},
376376
"tests/aws/services/resource_groups/test_resource_groups.py::TestResourceGroups::test_search_resources": {
377-
"recorded-date": "13-09-2023, 18:57:04",
377+
"recorded-date": "13-09-2023, 19:06:38",
378378
"recorded-content": {
379379
"queue-tags": {
380380
"Tags": {
@@ -389,7 +389,7 @@
389389
"QueryErrors": [],
390390
"ResourceIdentifiers": [
391391
{
392-
"ResourceArn": "arn:aws:sqs:<region>:111111111111:test-queue-15628f71",
392+
"ResourceArn": "arn:aws:sqs:<region>:111111111111:<resource:1>",
393393
"ResourceType": "AWS::SQS::Queue"
394394
}
395395
],

0 commit comments

Comments
 (0)
0