TechDebt - remove warnings from tests (#5390)

This commit is contained in:
Bert Blommers 2022-08-17 14:01:22 +00:00 committed by GitHub
parent 28963a273b
commit 9e1d78d44e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,6 @@
import base64
import ipaddress
import warnings
from unittest import SkipTest, mock
from uuid import uuid4
@ -2303,15 +2304,14 @@ def test_create_instance_with_launch_template_id_produces_no_warning(
LaunchTemplateName=str(uuid4()), LaunchTemplateData={"ImageId": EXAMPLE_AMI_ID}
)["LaunchTemplate"]
with pytest.warns(None) as captured_warnings:
with warnings.catch_warnings():
warnings.simplefilter("error")
resource.create_instances(
MinCount=1,
MaxCount=1,
LaunchTemplate={launch_template_kind: template[launch_template_kind]},
)
assert len(captured_warnings) == 0
@mock_ec2
def test_create_instance_from_launch_template__process_tags():

View File

@ -297,6 +297,7 @@ def test_get_all_spot_instance_requests_filtering():
@mock_ec2
@pytest.mark.filterwarnings("ignore")
def test_request_spot_instances_instance_lifecycle():
if settings.TEST_SERVER_MODE:
# Currently no easy way to check which instance was created by request_spot_instance
@ -312,6 +313,7 @@ def test_request_spot_instances_instance_lifecycle():
@mock_ec2
@pytest.mark.filterwarnings("ignore")
def test_request_spot_instances_with_tags():
client = boto3.client("ec2", region_name="us-east-1")
request = client.request_spot_instances(

View File

@ -74,6 +74,7 @@ input_instance_groups = [
@mock_emr
@pytest.mark.filterwarnings("ignore")
def test_describe_cluster():
region_name = "us-east-1"
client = boto3.client("emr", region_name=region_name)
@ -251,6 +252,7 @@ def test_describe_job_flows():
@mock_emr
@pytest.mark.filterwarnings("ignore")
def test_describe_job_flow():
client = boto3.client("emr", region_name="us-east-1")

View File

@ -589,10 +589,12 @@ def test_thing_group_already_exists_with_same_properties_returned():
current_thing_group = client.create_thing_group(
thingGroupName=thing_group_name, thingGroupProperties=thing_group_properties
)
current_thing_group.pop("ResponseMetadata")
thing_group = client.create_thing_group(
thingGroupName=thing_group_name, thingGroupProperties=thing_group_properties
)
thing_group.pop("ResponseMetadata")
assert thing_group == current_thing_group