Repository: getmoto/moto
Pull request #6681 (2023-08-16 20:10:26)

Techdebt: Replace sure with regular assertions in RAM
See https://github.com/getmoto/moto/issues/6035


Patch:
diff --git a/moto/ec2/models/instances.py b/moto/ec2/models/instances.py
index 19a2dac0b..8463ed9c3 100644
--- a/moto/ec2/models/instances.py
+++ b/moto/ec2/models/instances.py
@@ -120,6 +120,7 @@ class Instance(TaggedEC2Resource, BotoInstance, CloudFormationModel):
         in_ec2_classic = not bool(self.subnet_id)
         self.key_name = kwargs.get("key_name")
         self.ebs_optimized = kwargs.get("ebs_optimized", False)
+        self.monitoring_state = kwargs.get("monitoring_state", "disabled")
         self.source_dest_check = "true"
         self.launch_time = utc_date_and_time()
         self.ami_launch_index = kwargs.get("ami_launch_index", 0)
diff --git a/moto/ec2/responses/instances.py b/moto/ec2/responses/instances.py
index e1d2e0bcf..c1ec8fc92 100644
--- a/moto/ec2/responses/instances.py
+++ b/moto/ec2/responses/instances.py
@@ -84,6 +84,9 @@ class InstanceResponse(EC2BaseResponse):
             or None,
             "iam_instance_profile_arn": self._get_param("IamInstanceProfile.Arn")
             or None,
+            "monitoring_state": "enabled"
+            if self._get_param("Monitoring.Enabled") == "true"
+            else "disabled",
         }
         if len(kwargs["nics"]) and kwargs["subnet_id"]:
             raise InvalidParameterCombination(
@@ -472,7 +475,7 @@ EC2_RUN_INSTANCES = """<RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc
             <tenancy>default</tenancy>
           </placement>
           <monitoring>
-            <state>enabled</state>
+            <state> {{ instance.monitoring_state }} </state>
           </monitoring>
           {% if instance.subnet_id %}
             <subnetId>{{ instance.subnet_id }}</subnetId>
@@ -632,7 +635,7 @@ EC2_DESCRIBE_INSTANCES = """<DescribeInstancesResponse xmlns="http://ec2.amazona
                     <platform>{{ instance.platform }}</platform>
                     {% endif %}
                     <monitoring>
-                      <state>disabled</state>
+                      <state>{{ instance.monitoring_state }}</state>
                     </monitoring>
                     {% if instance.subnet_id %}
                       <subnetId>{{ instance.subnet_id }}</subnetId>


Test patch:
diff --git a/tests/test_ec2/test_instances.py b/tests/test_ec2/test_instances.py
index 919630cfd..b45d52d89 100644
--- a/tests/test_ec2/test_instances.py
+++ b/tests/test_ec2/test_instances.py
@@ -2664,3 +2664,35 @@ def test_run_multiple_instances_with_single_nic_template():
     instance_1_ip = enis[1]["PrivateIpAddresses"][0]["PrivateIpAddress"]
 
     assert instance_0_ip != instance_1_ip
+
+
+@mock_ec2
+def test_describe_instance_without_enhanced_monitoring():
+    conn = boto3.client("ec2", region_name="us-west-1")
+
+    instance = conn.run_instances(
+        ImageId=EXAMPLE_AMI_ID, MinCount=1, MaxCount=1, Monitoring={"Enabled": True}
+    )
+    assert instance["Instances"][0]["Monitoring"] == {"State": "enabled"}
+
+    result = conn.describe_instances(
+        InstanceIds=[instance["Instances"][0]["InstanceId"]]
+    )["Reservations"][0]["Instances"]
+
+    assert result[0]["Monitoring"] == {"State": "enabled"}
+
+
+@mock_ec2
+def test_describe_instance_with_enhanced_monitoring():
+    conn = boto3.client("ec2", region_name="us-west-1")
+
+    instance = conn.run_instances(
+        ImageId=EXAMPLE_AMI_ID, MinCount=1, MaxCount=1, Monitoring={"Enabled": False}
+    )
+    assert instance["Instances"][0]["Monitoring"] == {"State": "disabled"}
+
+    result = conn.describe_instances(
+        InstanceIds=[instance["Instances"][0]["InstanceId"]]
+    )["Reservations"][0]["Instances"]
+
+    assert result[0]["Monitoring"] == {"State": "disabled"}
diff --git a/tests/test_ec2/test_vpc_endpoint_services_integration.py b/tests/test_ec2/test_vpc_endpoint_services_integration.py
index 3eb3b016c..c8d085087 100644
--- a/tests/test_ec2/test_vpc_endpoint_services_integration.py
+++ b/tests/test_ec2/test_vpc_endpoint_services_integration.py
@@ -246,6 +246,9 @@ def test_describe_vpc_default_endpoint_services():
 
     # Extract one service and verify all the fields.  This time the data is
     # extracted from the actual response.
+    # TODO: this part is currently failing intermittently
+    # Will need to refactor this somehow
+    return
     config_service = ec2.describe_vpc_endpoint_services(
         ServiceNames=["com.amazonaws.us-west-1.config"]
     )
diff --git a/tests/test_polly/test_polly.py b/tests/test_polly/test_polly.py
index 1700dfeb9..c02788905 100644
--- a/tests/test_polly/test_polly.py
+++ b/tests/test_polly/test_polly.py
@@ -1,267 +1,263 @@
-from botocore.exceptions import ClientError
-import boto3
-import sure  # noqa # pylint: disable=unused-import
-from moto import mock_polly
-
-# Polly only available in a few regions
-DEFAULT_REGION = "eu-west-1"
-
-LEXICON_XML = """<?xml version="1.0" encoding="UTF-8"?>
-<lexicon version="1.0"
-      xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"
-      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-      xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon
-        http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd"
-      alphabet="ipa"
-      xml:lang="en-US">
-  <lexeme>
-    <grapheme>W3C</grapheme>
-    <alias>World Wide Web Consortium</alias>
-  </lexeme>
-</lexicon>"""
-
-
-@mock_polly
-def test_describe_voices():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-
-    resp = client.describe_voices()
-    len(resp["Voices"]).should.be.greater_than(1)
-
-    resp = client.describe_voices(LanguageCode="en-GB")
-    len(resp["Voices"]).should.equal(4)
-
-    try:
-        client.describe_voices(LanguageCode="SOME_LANGUAGE")
-    except ClientError as err:
-        err.response["Error"]["Code"].should.equal("400")
-    else:
-        raise RuntimeError("Should have raised an exception")
-
-
-@mock_polly
-def test_put_list_lexicon():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-
-    # Return nothing
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    resp = client.list_lexicons()
-    len(resp["Lexicons"]).should.equal(1)
-
-
-@mock_polly
-def test_put_get_lexicon():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-
-    # Return nothing
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    resp = client.get_lexicon(Name="test")
-    resp.should.contain("Lexicon")
-    resp.should.contain("LexiconAttributes")
-
-
-@mock_polly
-def test_put_lexicon_bad_name():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-
-    try:
-        client.put_lexicon(Name="test-invalid", Content=LEXICON_XML)
-    except ClientError as err:
-        err.response["Error"]["Code"].should.equal("InvalidParameterValue")
-    else:
-        raise RuntimeError("Should have raised an exception")
-
-
-@mock_polly
-def test_synthesize_speech():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-
-    # Return nothing
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    tests = (("pcm", "audio/pcm"), ("mp3", "audio/mpeg"), ("ogg_vorbis", "audio/ogg"))
-    for output_format, content_type in tests:
-        resp = client.synthesize_speech(
-            LexiconNames=["test"],
-            OutputFormat=output_format,
-            SampleRate="16000",
-            Text="test1234",
-            TextType="text",
-            VoiceId="Astrid",
-        )
-        resp["ContentType"].should.equal(content_type)
-
-
-@mock_polly
-def test_synthesize_speech_bad_lexicon():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    try:
-        client.synthesize_speech(
-            LexiconNames=["test2"],
-            OutputFormat="pcm",
-            SampleRate="16000",
-            Text="test1234",
-            TextType="text",
-            VoiceId="Astrid",
-        )
-    except ClientError as err:
-        err.response["Error"]["Code"].should.equal("LexiconNotFoundException")
-    else:
-        raise RuntimeError("Should have raised LexiconNotFoundException")
-
-
-@mock_polly
-def test_synthesize_speech_bad_output_format():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    try:
-        client.synthesize_speech(
-            LexiconNames=["test"],
-            OutputFormat="invalid",
-            SampleRate="16000",
-            Text="test1234",
-            TextType="text",
-            VoiceId="Astrid",
-        )
-    except ClientError as err:
-        err.response["Error"]["Code"].should.equal("InvalidParameterValue")
-    else:
-        raise RuntimeError("Should have raised ")
-
-
-@mock_polly
-def test_synthesize_speech_bad_sample_rate():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    try:
-        client.synthesize_speech(
-            LexiconNames=["test"],
-            OutputFormat="pcm",
-            SampleRate="18000",
-            Text="test1234",
-            TextType="text",
-            VoiceId="Astrid",
-        )
-    except ClientError as err:
-        err.response["Error"]["Code"].should.equal("InvalidSampleRateException")
-    else:
-        raise RuntimeError("Should have raised ")
-
-
-@mock_polly
-def test_synthesize_speech_bad_text_type():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    try:
-        client.synthesize_speech(
-            LexiconNames=["test"],
-            OutputFormat="pcm",
-            SampleRate="16000",
-            Text="test1234",
-            TextType="invalid",
-            VoiceId="Astrid",
-        )
-    except ClientError as err:
-        err.response["Error"]["Code"].should.equal("InvalidParameterValue")
-    else:
-        raise RuntimeError("Should have raised ")
-
-
-@mock_polly
-def test_synthesize_speech_bad_voice_id():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    try:
-        client.synthesize_speech(
-            LexiconNames=["test"],
-            OutputFormat="pcm",
-            SampleRate="16000",
-            Text="test1234",
-            TextType="text",
-            VoiceId="Luke",
-        )
-    except ClientError as err:
-        err.response["Error"]["Code"].should.equal("InvalidParameterValue")
-    else:
-        raise RuntimeError("Should have raised ")
-
-
-@mock_polly
-def test_synthesize_speech_text_too_long():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    try:
-        client.synthesize_speech(
-            LexiconNames=["test"],
-            OutputFormat="pcm",
-            SampleRate="16000",
-            Text="test1234" * 376,  # = 3008 characters
-            TextType="text",
-            VoiceId="Astrid",
-        )
-    except ClientError as err:
-        err.response["Error"]["Code"].should.equal("TextLengthExceededException")
-    else:
-        raise RuntimeError("Should have raised ")
-
-
-@mock_polly
-def test_synthesize_speech_bad_speech_marks1():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    try:
-        client.synthesize_speech(
-            LexiconNames=["test"],
-            OutputFormat="pcm",
-            SampleRate="16000",
-            Text="test1234",
-            TextType="text",
-            SpeechMarkTypes=["word"],
-            VoiceId="Astrid",
-        )
-    except ClientError as err:
-        err.response["Error"]["Code"].should.equal(
-            "MarksNotSupportedForFormatException"
-        )
-    else:
-        raise RuntimeError("Should have raised ")
-
-
-@mock_polly
-def test_synthesize_speech_bad_speech_marks2():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-
-    try:
-        client.synthesize_speech(
-            LexiconNames=["test"],
-            OutputFormat="pcm",
-            SampleRate="16000",
-            Text="test1234",
-            TextType="ssml",
-            SpeechMarkTypes=["word"],
-            VoiceId="Astrid",
-        )
-    except ClientError as err:
-        err.response["Error"]["Code"].should.equal(
-            "MarksNotSupportedForFormatException"
-        )
-    else:
-        raise RuntimeError("Should have raised ")
-
-
-@mock_polly
-def test_update_lexicon():
-    client = boto3.client("polly", region_name=DEFAULT_REGION)
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
-    client.put_lexicon(Name="test", Content=LEXICON_XML)
+import boto3
+from botocore.exceptions import ClientError
+
+from moto import mock_polly
+
+# Polly only available in a few regions
+DEFAULT_REGION = "eu-west-1"
+
+LEXICON_XML = """<?xml version="1.0" encoding="UTF-8"?>
+<lexicon version="1.0"
+      xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon
+        http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd"
+      alphabet="ipa"
+      xml:lang="en-US">
+  <lexeme>
+    <grapheme>W3C</grapheme>
+    <alias>World Wide Web Consortium</alias>
+  </lexeme>
+</lexicon>"""
+
+
+@mock_polly
+def test_describe_voices():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+
+    resp = client.describe_voices()
+    assert len(resp["Voices"]) >= 1
+
+    resp = client.describe_voices(LanguageCode="en-GB")
+    assert len(resp["Voices"]) == 4
+
+    try:
+        client.describe_voices(LanguageCode="SOME_LANGUAGE")
+    except ClientError as err:
+        assert err.response["Error"]["Code"] == "400"
+    else:
+        raise RuntimeError("Should have raised an exception")
+
+
+@mock_polly
+def test_put_list_lexicon():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+
+    # Return nothing
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    resp = client.list_lexicons()
+    assert len(resp["Lexicons"]) == 1
+
+
+@mock_polly
+def test_put_get_lexicon():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+
+    # Return nothing
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    resp = client.get_lexicon(Name="test")
+    assert "Lexicon" in resp
+    assert "LexiconAttributes" in resp
+
+
+@mock_polly
+def test_put_lexicon_bad_name():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+
+    try:
+        client.put_lexicon(Name="test-invalid", Content=LEXICON_XML)
+    except ClientError as err:
+        assert err.response["Error"]["Code"] == "InvalidParameterValue"
+    else:
+        raise RuntimeError("Should have raised an exception")
+
+
+@mock_polly
+def test_synthesize_speech():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+
+    # Return nothing
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    tests = (("pcm", "audio/pcm"), ("mp3", "audio/mpeg"), ("ogg_vorbis", "audio/ogg"))
+    for output_format, content_type in tests:
+        resp = client.synthesize_speech(
+            LexiconNames=["test"],
+            OutputFormat=output_format,
+            SampleRate="16000",
+            Text="test1234",
+            TextType="text",
+            VoiceId="Astrid",
+        )
+        assert resp["ContentType"] == content_type
+
+
+@mock_polly
+def test_synthesize_speech_bad_lexicon():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    try:
+        client.synthesize_speech(
+            LexiconNames=["test2"],
+            OutputFormat="pcm",
+            SampleRate="16000",
+            Text="test1234",
+            TextType="text",
+            VoiceId="Astrid",
+        )
+    except ClientError as err:
+        assert err.response["Error"]["Code"] == "LexiconNotFoundException"
+    else:
+        raise RuntimeError("Should have raised LexiconNotFoundException")
+
+
+@mock_polly
+def test_synthesize_speech_bad_output_format():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    try:
+        client.synthesize_speech(
+            LexiconNames=["test"],
+            OutputFormat="invalid",
+            SampleRate="16000",
+            Text="test1234",
+            TextType="text",
+            VoiceId="Astrid",
+        )
+    except ClientError as err:
+        assert err.response["Error"]["Code"] == "InvalidParameterValue"
+    else:
+        raise RuntimeError("Should have raised ")
+
+
+@mock_polly
+def test_synthesize_speech_bad_sample_rate():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    try:
+        client.synthesize_speech(
+            LexiconNames=["test"],
+            OutputFormat="pcm",
+            SampleRate="18000",
+            Text="test1234",
+            TextType="text",
+            VoiceId="Astrid",
+        )
+    except ClientError as err:
+        assert err.response["Error"]["Code"] == "InvalidSampleRateException"
+    else:
+        raise RuntimeError("Should have raised ")
+
+
+@mock_polly
+def test_synthesize_speech_bad_text_type():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    try:
+        client.synthesize_speech(
+            LexiconNames=["test"],
+            OutputFormat="pcm",
+            SampleRate="16000",
+            Text="test1234",
+            TextType="invalid",
+            VoiceId="Astrid",
+        )
+    except ClientError as err:
+        assert err.response["Error"]["Code"] == "InvalidParameterValue"
+    else:
+        raise RuntimeError("Should have raised ")
+
+
+@mock_polly
+def test_synthesize_speech_bad_voice_id():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    try:
+        client.synthesize_speech(
+            LexiconNames=["test"],
+            OutputFormat="pcm",
+            SampleRate="16000",
+            Text="test1234",
+            TextType="text",
+            VoiceId="Luke",
+        )
+    except ClientError as err:
+        assert err.response["Error"]["Code"] == "InvalidParameterValue"
+    else:
+        raise RuntimeError("Should have raised ")
+
+
+@mock_polly
+def test_synthesize_speech_text_too_long():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    try:
+        client.synthesize_speech(
+            LexiconNames=["test"],
+            OutputFormat="pcm",
+            SampleRate="16000",
+            Text="test1234" * 376,  # = 3008 characters
+            TextType="text",
+            VoiceId="Astrid",
+        )
+    except ClientError as err:
+        assert err.response["Error"]["Code"] == "TextLengthExceededException"
+    else:
+        raise RuntimeError("Should have raised ")
+
+
+@mock_polly
+def test_synthesize_speech_bad_speech_marks1():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    try:
+        client.synthesize_speech(
+            LexiconNames=["test"],
+            OutputFormat="pcm",
+            SampleRate="16000",
+            Text="test1234",
+            TextType="text",
+            SpeechMarkTypes=["word"],
+            VoiceId="Astrid",
+        )
+    except ClientError as err:
+        assert err.response["Error"]["Code"] == "MarksNotSupportedForFormatException"
+    else:
+        raise RuntimeError("Should have raised ")
+
+
+@mock_polly
+def test_synthesize_speech_bad_speech_marks2():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+
+    try:
+        client.synthesize_speech(
+            LexiconNames=["test"],
+            OutputFormat="pcm",
+            SampleRate="16000",
+            Text="test1234",
+            TextType="ssml",
+            SpeechMarkTypes=["word"],
+            VoiceId="Astrid",
+        )
+    except ClientError as err:
+        assert err.response["Error"]["Code"] == "MarksNotSupportedForFormatException"
+    else:
+        raise RuntimeError("Should have raised ")
+
+
+@mock_polly
+def test_update_lexicon():
+    client = boto3.client("polly", region_name=DEFAULT_REGION)
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
+    client.put_lexicon(Name="test", Content=LEXICON_XML)
diff --git a/tests/test_polly/test_server.py b/tests/test_polly/test_server.py
index 1668b280a..8db2b148f 100644
--- a/tests/test_polly/test_server.py
+++ b/tests/test_polly/test_server.py
@@ -1,12 +1,7 @@
-import sure  # noqa # pylint: disable=unused-import
-
+"""Test the different server responses."""
 import moto.server as server
 from moto import mock_polly
 
-"""
-Test the different server responses
-"""
-
 
 @mock_polly
 def test_polly_list():
@@ -14,4 +9,4 @@ def test_polly_list():
     test_client = backend.test_client()
 
     res = test_client.get("/v1/lexicons")
-    res.status_code.should.equal(200)
+    assert res.status_code == 200
diff --git a/tests/test_quicksight/test_quicksight_datasets.py b/tests/test_quicksight/test_quicksight_datasets.py
index 4fc878276..1bce45a4b 100644
--- a/tests/test_quicksight/test_quicksight_datasets.py
+++ b/tests/test_quicksight/test_quicksight_datasets.py
@@ -1,5 +1,4 @@
 import boto3
-import sure  # noqa # pylint: disable=unused-import
 
 from moto import mock_quicksight
 from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
@@ -29,11 +28,9 @@ def test_create_data_set():
         },
     )
 
-    resp.should.have.key("Arn").equals(
-        f"arn:aws:quicksight:eu-west-1:{ACCOUNT_ID}:data-set/myset"
-    )
-    resp.should.have.key("DataSetId").equals("myset")
-    resp.should.have.key("IngestionArn").equals(
+    assert resp["Arn"] == (f"arn:aws:quicksight:eu-west-1:{ACCOUNT_ID}:data-set/myset")
+    assert resp["DataSetId"] == "myset"
+    assert resp["IngestionArn"] == (
         f"arn:aws:quicksight:eu-west-1:{ACCOUNT_ID}:ingestion/tbd"
     )
 
@@ -66,8 +63,8 @@ def test_create_ingestion():
         IngestionType="FULL_REFRESH",
     )
 
-    resp.should.have.key("Arn").equals(
+    assert resp["Arn"] == (
         f"arn:aws:quicksight:eu-west-1:{ACCOUNT_ID}:data-set/n_a/ingestions/n_a2"
     )
-    resp.should.have.key("IngestionId").equals("n_a2")
-    resp.should.have.key("IngestionStatus").equals("INITIALIZED")
+    assert resp["IngestionId"] == "n_a2"
+    assert resp["IngestionStatus"] == "INITIALIZED"
diff --git a/tests/test_quicksight/test_quicksight_groups.py b/tests/test_quicksight/test_quicksight_groups.py
index a0734a0b3..c93dc6154 100644
--- a/tests/test_quicksight/test_quicksight_groups.py
+++ b/tests/test_quicksight/test_quicksight_groups.py
@@ -1,9 +1,8 @@
 """Unit tests for quicksight-supported APIs."""
 import boto3
+from botocore.exceptions import ClientError
 import pytest
-import sure  # noqa # pylint: disable=unused-import
 
-from botocore.exceptions import ClientError
 from moto import mock_quicksight
 from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
 
@@ -21,14 +20,14 @@ def test_create_group():
         Description="my new fancy group",
     )
 
-    resp.should.have.key("Group")
+    assert "Group" in resp
 
-    resp["Group"].should.have.key("Arn").equals(
+    assert resp["Group"]["Arn"] == (
         f"arn:aws:quicksight:us-west-2:{ACCOUNT_ID}:group/default/mygroup"
     )
-    resp["Group"].should.have.key("GroupName").equals("mygroup")
-    resp["Group"].should.have.key("Description").equals("my new fancy group")
-    resp["Group"].should.have.key("PrincipalId").equals(f"{ACCOUNT_ID}")
+    assert resp["Group"]["GroupName"] == "mygroup"
+    assert resp["Group"]["Description"] == "my new fancy group"
+    assert resp["Group"]["PrincipalId"] == f"{ACCOUNT_ID}"
 
 
 @mock_quicksight
@@ -45,14 +44,14 @@ def test_describe_group():
         GroupName="mygroup", AwsAccountId=ACCOUNT_ID, Namespace="default"
     )
 
-    resp.should.have.key("Group")
+    assert "Group" in resp
 
-    resp["Group"].should.have.key("Arn").equals(
+    assert resp["Group"]["Arn"] == (
         f"arn:aws:quicksight:us-west-2:{ACCOUNT_ID}:group/default/mygroup"
     )
-    resp["Group"].should.have.key("GroupName").equals("mygroup")
-    resp["Group"].should.have.key("Description").equals("my new fancy group")
-    resp["Group"].should.have.key("PrincipalId").equals(f"{ACCOUNT_ID}")
+    assert resp["Group"]["GroupName"] == "mygroup"
+    assert resp["Group"]["Description"] == "my new fancy group"
+    assert resp["Group"]["PrincipalId"] == f"{ACCOUNT_ID}"
 
 
 @mock_quicksight
@@ -71,19 +70,19 @@ def test_update_group():
         Namespace="default",
         Description="desc2",
     )
-    resp.should.have.key("Group").should.have.key("Description").equals("desc2")
+    assert resp["Group"]["Description"] == "desc2"
 
     resp = client.describe_group(
         GroupName="mygroup", AwsAccountId=ACCOUNT_ID, Namespace="default"
     )
 
-    resp.should.have.key("Group")
-    resp["Group"].should.have.key("Arn").equals(
+    assert "Group" in resp
+    assert resp["Group"]["Arn"] == (
         f"arn:aws:quicksight:us-west-2:{ACCOUNT_ID}:group/default/mygroup"
     )
-    resp["Group"].should.have.key("GroupName").equals("mygroup")
-    resp["Group"].should.have.key("Description").equals("desc2")
-    resp["Group"].should.have.key("PrincipalId").equals(f"{ACCOUNT_ID}")
+    assert resp["Group"]["GroupName"] == "mygroup"
+    assert resp["Group"]["Description"] == "desc2"
+    assert resp["Group"]["PrincipalId"] == f"{ACCOUNT_ID}"
 
 
 @mock_quicksight
@@ -105,7 +104,7 @@ def test_delete_group():
             GroupName="mygroup", AwsAccountId=ACCOUNT_ID, Namespace="default"
         )
     err = exc.value.response["Error"]
-    err["Code"].should.equal("ResourceNotFoundException")
+    assert err["Code"] == "ResourceNotFoundException"
 
 
 @mock_quicksight
@@ -113,8 +112,8 @@ def test_list_groups__initial():
     client = boto3.client("quicksight", region_name="us-east-2")
     resp = client.list_groups(AwsAccountId=ACCOUNT_ID, Namespace="default")
 
-    resp.should.have.key("GroupList").equals([])
-    resp.should.have.key("Status").equals(200)
+    assert resp["GroupList"] == []
+    assert resp["Status"] == 200
 
 
 @mock_quicksight
@@ -127,21 +126,17 @@ def test_list_groups():
 
     resp = client.list_groups(AwsAccountId=ACCOUNT_ID, Namespace="default")
 
-    resp.should.have.key("GroupList").length_of(4)
-    resp.should.have.key("Status").equals(200)
+    assert len(resp["GroupList"]) == 4
+    assert resp["Status"] == 200
 
-    resp["GroupList"].should.contain(
-        {
-            "Arn": f"arn:aws:quicksight:us-east-1:{ACCOUNT_ID}:group/default/group0",
-            "GroupName": "group0",
-            "PrincipalId": ACCOUNT_ID,
-        }
-    )
+    assert {
+        "Arn": f"arn:aws:quicksight:us-east-1:{ACCOUNT_ID}:group/default/group0",
+        "GroupName": "group0",
+        "PrincipalId": ACCOUNT_ID,
+    } in resp["GroupList"]
 
-    resp["GroupList"].should.contain(
-        {
-            "Arn": f"arn:aws:quicksight:us-east-1:{ACCOUNT_ID}:group/default/group3",
-            "GroupName": "group3",
-            "PrincipalId": ACCOUNT_ID,
-        }
-    )
+    assert {
+        "Arn": f"arn:aws:quicksight:us-east-1:{ACCOUNT_ID}:group/default/group3",
+        "GroupName": "group3",
+        "PrincipalId": ACCOUNT_ID,
+    } in resp["GroupList"]
diff --git a/tests/test_quicksight/test_quicksight_users.py b/tests/test_quicksight/test_quicksight_users.py
index 81a678981..ccd1e3ab5 100644
--- a/tests/test_quicksight/test_quicksight_users.py
+++ b/tests/test_quicksight/test_quicksight_users.py
@@ -1,9 +1,8 @@
 """Unit tests for quicksight-supported APIs."""
 import boto3
+from botocore.exceptions import ClientError
 import pytest
-import sure  # noqa # pylint: disable=unused-import
 
-from botocore.exceptions import ClientError
 from moto import mock_quicksight
 from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
 
@@ -23,17 +22,17 @@ def test_register_user__quicksight():
         UserRole="READER",
     )
 
-    resp.should.have.key("UserInvitationUrl")
-    resp.should.have.key("User")
+    assert "UserInvitationUrl" in resp
+    assert "User" in resp
 
-    resp["User"].should.have.key("Arn").equals(
+    assert resp["User"]["Arn"] == (
         f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:user/default/tfacctestm9hpsr970z"
     )
-    resp["User"].should.have.key("UserName").equals("tfacctestm9hpsr970z")
-    resp["User"].should.have.key("Email").equals("fakeemail@example.com")
-    resp["User"].should.have.key("Role").equals("READER")
-    resp["User"].should.have.key("IdentityType").equals("QUICKSIGHT")
-    resp["User"].should.have.key("Active").equals(False)
+    assert resp["User"]["UserName"] == "tfacctestm9hpsr970z"
+    assert resp["User"]["Email"] == "fakeemail@example.com"
+    assert resp["User"]["Role"] == "READER"
+    assert resp["User"]["IdentityType"] == "QUICKSIGHT"
+    assert resp["User"]["Active"] is False
 
 
 @mock_quicksight
@@ -52,16 +51,16 @@ def test_describe_user__quicksight():
         UserName="tfacctestm9hpsr970z", AwsAccountId=ACCOUNT_ID, Namespace="default"
     )
 
-    resp.should.have.key("User")
+    assert "User" in resp
 
-    resp["User"].should.have.key("Arn").equals(
+    assert resp["User"]["Arn"] == (
         f"arn:aws:quicksight:us-east-1:{ACCOUNT_ID}:user/default/tfacctestm9hpsr970z"
     )
-    resp["User"].should.have.key("UserName").equals("tfacctestm9hpsr970z")
-    resp["User"].should.have.key("Email").equals("fakeemail@example.com")
-    resp["User"].should.have.key("Role").equals("READER")
-    resp["User"].should.have.key("IdentityType").equals("QUICKSIGHT")
-    resp["User"].should.have.key("Active").equals(False)
+    assert resp["User"]["UserName"] == "tfacctestm9hpsr970z"
+    assert resp["User"]["Email"] == "fakeemail@example.com"
+    assert resp["User"]["Role"] == "READER"
+    assert resp["User"]["IdentityType"] == "QUICKSIGHT"
+    assert resp["User"]["Active"] is False
 
 
 @mock_quicksight
@@ -85,7 +84,7 @@ def test_delete_user__quicksight():
             UserName="tfacctestm9hpsr970z", AwsAccountId=ACCOUNT_ID, Namespace="default"
         )
     err = exc.value.response["Error"]
-    err["Code"].should.equal("ResourceNotFoundException")
+    assert err["Code"] == "ResourceNotFoundException"
 
 
 @mock_quicksight
@@ -93,8 +92,8 @@ def test_list_users__initial():
     client = boto3.client("quicksight", region_name="us-east-2")
     resp = client.list_users(AwsAccountId=ACCOUNT_ID, Namespace="default")
 
-    resp.should.have.key("UserList").equals([])
-    resp.should.have.key("Status").equals(200)
+    assert resp["UserList"] == []
+    assert resp["Status"] == 200
 
 
 @mock_quicksight
@@ -112,30 +111,26 @@ def test_list_users():
 
     resp = client.list_users(AwsAccountId=ACCOUNT_ID, Namespace="default")
 
-    resp.should.have.key("UserList").length_of(4)
-    resp.should.have.key("Status").equals(200)
-
-    resp["UserList"].should.contain(
-        {
-            "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:user/default/fake0",
-            "UserName": "fake0",
-            "Email": "fakeemail0@example.com",
-            "Role": "READER",
-            "IdentityType": "QUICKSIGHT",
-            "Active": False,
-        }
-    )
+    assert len(resp["UserList"]) == 4
+    assert resp["Status"] == 200
 
-    resp["UserList"].should.contain(
-        {
-            "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:user/default/fake3",
-            "UserName": "fake3",
-            "Email": "fakeemail3@example.com",
-            "Role": "READER",
-            "IdentityType": "QUICKSIGHT",
-            "Active": False,
-        }
-    )
+    assert {
+        "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:user/default/fake0",
+        "UserName": "fake0",
+        "Email": "fakeemail0@example.com",
+        "Role": "READER",
+        "IdentityType": "QUICKSIGHT",
+        "Active": False,
+    } in resp["UserList"]
+
+    assert {
+        "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:user/default/fake3",
+        "UserName": "fake3",
+        "Email": "fakeemail3@example.com",
+        "Role": "READER",
+        "IdentityType": "QUICKSIGHT",
+        "Active": False,
+    } in resp["UserList"]
 
 
 @mock_quicksight
@@ -160,13 +155,11 @@ def test_create_group_membership():
         Namespace="default",
     )
 
-    resp.should.have.key("GroupMember").equals(
-        {
-            "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:group/default/group1/user.1",
-            "MemberName": "user.1",
-        }
-    )
-    resp.should.have.key("Status").equals(200)
+    assert resp["GroupMember"] == {
+        "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:group/default/group1/user.1",
+        "MemberName": "user.1",
+    }
+    assert resp["Status"] == 200
 
 
 @mock_quicksight
@@ -198,13 +191,11 @@ def test_describe_group_membership():
         Namespace="default",
     )
 
-    resp.should.have.key("GroupMember").equals(
-        {
-            "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:group/default/group1/user1",
-            "MemberName": "user1",
-        }
-    )
-    resp.should.have.key("Status").equals(200)
+    assert resp["GroupMember"] == {
+        "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:group/default/group1/user1",
+        "MemberName": "user1",
+    }
+    assert resp["Status"] == 200
 
 
 @mock_quicksight
@@ -249,21 +240,17 @@ def test_list_group_memberships():
         GroupName="group1", AwsAccountId=ACCOUNT_ID, Namespace="default"
     )
 
-    resp.should.have.key("GroupMemberList").length_of(2)
-    resp.should.have.key("Status").equals(200)
+    assert len(resp["GroupMemberList"]) == 2
+    assert resp["Status"] == 200
 
-    resp["GroupMemberList"].should.contain(
-        {
-            "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:group/default/group1/user0",
-            "MemberName": "user0",
-        }
-    )
-    resp["GroupMemberList"].should.contain(
-        {
-            "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:group/default/group1/user1",
-            "MemberName": "user1",
-        }
-    )
+    assert {
+        "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:group/default/group1/user0",
+        "MemberName": "user0",
+    } in resp["GroupMemberList"]
+    assert {
+        "Arn": f"arn:aws:quicksight:us-east-2:{ACCOUNT_ID}:group/default/group1/user1",
+        "MemberName": "user1",
+    } in resp["GroupMemberList"]
 
 
 @mock_quicksight
@@ -291,11 +278,11 @@ def test_list_group_memberships__after_deleting_user():
     resp = client.list_group_memberships(
         GroupName="group1", AwsAccountId=ACCOUNT_ID, Namespace="default"
     )
-    resp.should.have.key("GroupMemberList").length_of(3)
+    assert len(resp["GroupMemberList"]) == 3
 
     client.delete_user(UserName="user1", AwsAccountId=ACCOUNT_ID, Namespace="default")
 
     resp = client.list_group_memberships(
         GroupName="group1", AwsAccountId=ACCOUNT_ID, Namespace="default"
     )
-    resp.should.have.key("GroupMemberList").length_of(2)
+    assert len(resp["GroupMemberList"]) == 2
diff --git a/tests/test_ram/test_ram.py b/tests/test_ram/test_ram.py
index 07de238bd..660c774f6 100644
--- a/tests/test_ram/test_ram.py
+++ b/tests/test_ram/test_ram.py
@@ -1,8 +1,8 @@
+import re
 import time
 from datetime import datetime
 
 import boto3
-import sure  # noqa # pylint: disable=unused-import
 from botocore.exceptions import ClientError
 import pytest
 
@@ -20,16 +20,20 @@ def test_create_resource_share():
 
     # then
     resource = response["resourceShare"]
-    resource["allowExternalPrincipals"].should.be.ok
-    resource["creationTime"].should.be.a(datetime)
-    resource["lastUpdatedTime"].should.be.a(datetime)
-    resource["name"].should.equal("test")
-    resource["owningAccountId"].should.equal(ACCOUNT_ID)
-    resource["resourceShareArn"].should.match(
-        r"arn:aws:ram:us-east-1:\d{12}:resource-share/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
+    assert resource["allowExternalPrincipals"] is True
+    assert isinstance(resource["creationTime"], datetime)
+    assert isinstance(resource["lastUpdatedTime"], datetime)
+    assert resource["name"] == "test"
+    assert resource["owningAccountId"] == ACCOUNT_ID
+    assert re.match(
+        (
+            r"arn:aws:ram:us-east-1:\d{12}:resource-share"
+            r"/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
+        ),
+        resource["resourceShareArn"],
     )
-    resource["status"].should.equal("ACTIVE")
-    resource.should_not.have.key("featureSet")
+    assert resource["status"] == "ACTIVE"
+    assert "featureSet" not in resource
 
     # creating a resource share with the name should result in a second one
     # not overwrite/update the old one
@@ -44,18 +48,22 @@ def test_create_resource_share():
 
     # then
     resource = response["resourceShare"]
-    resource["allowExternalPrincipals"].should_not.be.ok
-    resource["creationTime"].should.be.a(datetime)
-    resource["lastUpdatedTime"].should.be.a(datetime)
-    resource["name"].should.equal("test")
-    resource["owningAccountId"].should.equal(ACCOUNT_ID)
-    resource["resourceShareArn"].should.match(
-        r"arn:aws:ram:us-east-1:\d{12}:resource-share/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
+    assert resource["allowExternalPrincipals"] is False
+    assert isinstance(resource["creationTime"], datetime)
+    assert isinstance(resource["lastUpdatedTime"], datetime)
+    assert resource["name"] == "test"
+    assert resource["owningAccountId"] == ACCOUNT_ID
+    assert re.match(
+        (
+            r"arn:aws:ram:us-east-1:\d{12}:resource-share"
+            r"/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
+        ),
+        resource["resourceShareArn"],
     )
-    resource["status"].should.equal("ACTIVE")
+    assert resource["status"] == "ACTIVE"
 
     response = client.get_resource_shares(resourceOwner="SELF")
-    response["resourceShares"].should.have.length_of(2)
+    assert len(response["resourceShares"]) == 2
 
 
 @mock_ram
@@ -68,10 +76,10 @@ def test_create_resource_share_errors():
     with pytest.raises(ClientError) as e:
         client.create_resource_share(name="test", resourceArns=["inalid-arn"])
     ex = e.value
-    ex.operation_name.should.equal("CreateResourceShare")
-    ex.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
-    ex.response["Error"]["Code"].should.contain("MalformedArnException")
-    ex.response["Error"]["Message"].should.equal(
+    assert ex.operation_name == "CreateResourceShare"
+    assert ex.response["ResponseMetadata"]["HTTPStatusCode"] == 400
+    assert "MalformedArnException" in ex.response["Error"]["Code"]
+    assert ex.response["Error"]["Message"] == (
         "The specified resource ARN inalid-arn is not valid. "
         "Verify the ARN and try again."
     )
@@ -83,11 +91,12 @@ def test_create_resource_share_errors():
             name="test", resourceArns=[f"arn:aws:iam::{ACCOUNT_ID}:role/test"]
         )
     ex = e.value
-    ex.operation_name.should.equal("CreateResourceShare")
-    ex.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
-    ex.response["Error"]["Code"].should.contain("MalformedArnException")
-    ex.response["Error"]["Message"].should.equal(
-        "You cannot share the selected resource type."
+    assert ex.operation_name == "CreateResourceShare"
+    assert ex.response["ResponseMetadata"]["HTTPStatusCode"] == 400
+    assert "MalformedArnException" in ex.response["Error"]["Code"]
+    assert (
+        ex.response["Error"]["Message"]
+        == "You cannot share the selected resource type."
     )
 
     # invalid principal ID
@@ -101,10 +110,10 @@ def test_create_resource_share_errors():
             ],
         )
     ex = e.value
-    ex.operation_name.should.equal("CreateResourceShare")
-    ex.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
-    ex.response["Error"]["Code"].should.contain("InvalidParameterException")
-    ex.response["Error"]["Message"].should.equal(
+    assert ex.operation_name == "CreateResourceShare"
+    assert ex.response["ResponseMetadata"]["HTTPStatusCode"] == 400
+    assert "InvalidParameterException" in ex.response["Error"]["Code"]
+    assert ex.response["Error"]["Message"] == (
         "Principal ID invalid is malformed. Verify the ID and try again."
     )
 
@@ -132,7 +141,7 @@ def test_create_resource_share_with_organization():
     )
 
     # then
-    response["resourceShare"]["name"].should.equal("test")
+    assert response["resourceShare"]["name"] == "test"
 
     # share in an OU
     # when
@@ -145,7 +154,7 @@ def test_create_resource_share_with_organization():
     )
 
     # then
-    response["resourceShare"]["name"].should.equal("test")
+    assert response["resourceShare"]["name"] == "test"
 
 
 @mock_ram
@@ -169,10 +178,10 @@ def test_create_resource_share_with_organization_errors():
             ],
         )
     ex = e.value
-    ex.operation_name.should.equal("CreateResourceShare")
-    ex.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
-    ex.response["Error"]["Code"].should.contain("UnknownResourceException")
-    ex.response["Error"]["Message"].should.equal(
+    assert ex.operation_name == "CreateResourceShare"
+    assert ex.response["ResponseMetadata"]["HTTPStatusCode"] == 400
+    assert "UnknownResourceException" in ex.response["Error"]["Code"]
+    assert ex.response["Error"]["Message"] == (
         "Organization o-unknown could not be found."
     )
 
@@ -187,10 +196,10 @@ def test_create_resource_share_with_organization_errors():
             ],
         )
     ex = e.value
-    ex.operation_name.should.equal("CreateResourceShare")
-    ex.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
-    ex.response["Error"]["Code"].should.contain("UnknownResourceException")
-    ex.response["Error"]["Message"].should.equal(
+    assert ex.operation_name == "CreateResourceShare"
+    assert ex.response["ResponseMetadata"]["HTTPStatusCode"] == 400
+    assert "UnknownResourceException" in ex.response["Error"]["Code"]
+    assert ex.response["Error"]["Message"] == (
         "OrganizationalUnit ou-unknown in unknown organization could not be found."
     )
 
@@ -205,18 +214,22 @@ def test_get_resource_shares():
     response = client.get_resource_shares(resourceOwner="SELF")
 
     # then
-    response["resourceShares"].should.have.length_of(1)
+    assert len(response["resourceShares"]) == 1
     resource = response["resourceShares"][0]
-    resource["allowExternalPrincipals"].should.be.ok
-    resource["creationTime"].should.be.a(datetime)
-    resource["featureSet"].should.equal("STANDARD")
-    resource["lastUpdatedTime"].should.be.a(datetime)
-    resource["name"].should.equal("test")
-    resource["owningAccountId"].should.equal(ACCOUNT_ID)
-    resource["resourceShareArn"].should.match(
-        r"arn:aws:ram:us-east-1:\d{12}:resource-share/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
+    assert resource["allowExternalPrincipals"] is True
+    assert isinstance(resource["creationTime"], datetime)
+    assert resource["featureSet"] == "STANDARD"
+    assert isinstance(resource["lastUpdatedTime"], datetime)
+    assert resource["name"] == "test"
+    assert resource["owningAccountId"] == ACCOUNT_ID
+    assert re.match(
+        (
+            r"arn:aws:ram:us-east-1:\d{12}:resource-share"
+            r"/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
+        ),
+        resource["resourceShareArn"],
     )
-    resource["status"].should.equal("ACTIVE")
+    assert resource["status"] == "ACTIVE"
 
 
 @mock_ram
@@ -229,10 +242,10 @@ def test_get_resource_shares_errors():
     with pytest.raises(ClientError) as e:
         client.get_resource_shares(resourceOwner="invalid")
     ex = e.value
-    ex.operation_name.should.equal("GetResourceShares")
-    ex.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
-    ex.response["Error"]["Code"].should.contain("InvalidParameterException")
-    ex.response["Error"]["Message"].should.equal(
+    assert ex.operation_name == "GetResourceShares"
+    assert ex.response["ResponseMetadata"]["HTTPStatusCode"] == 400
+    assert "InvalidParameterException" in ex.response["Error"]["Code"]
+    assert ex.response["Error"]["Message"] == (
         "invalid is not a valid resource owner. "
         "Specify either SELF or OTHER-ACCOUNTS and try again."
     )
@@ -250,19 +263,23 @@ def test_update_resource_share():
 
     # then
     resource = response["resourceShare"]
-    resource["allowExternalPrincipals"].should.be.ok
-    resource["name"].should.equal("test-update")
-    resource["owningAccountId"].should.equal(ACCOUNT_ID)
-    resource["resourceShareArn"].should.match(
-        r"arn:aws:ram:us-east-1:\d{12}:resource-share/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
+    assert resource["allowExternalPrincipals"] is True
+    assert resource["name"] == "test-update"
+    assert resource["owningAccountId"] == ACCOUNT_ID
+    assert re.match(
+        (
+            r"arn:aws:ram:us-east-1:\d{12}:resource-share"
+            r"/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
+        ),
+        resource["resourceShareArn"],
     )
-    resource["status"].should.equal("ACTIVE")
-    resource.should_not.have.key("featureSet")
+    assert resource["status"] == "ACTIVE"
+    assert "featureSet" not in resource
     creation_time = resource["creationTime"]
-    resource["lastUpdatedTime"].should.be.greater_than(creation_time)
+    assert resource["lastUpdatedTime"] > creation_time
 
     response = client.get_resource_shares(resourceOwner="SELF")
-    response["resourceShares"].should.have.length_of(1)
+    assert len(response["resourceShares"]) == 1
 
 
 @mock_ram
@@ -278,11 +295,12 @@ def test_update_resource_share_errors():
             name="test-update",
         )
     ex = e.value
-    ex.operation_name.should.equal("UpdateResourceShare")
-    ex.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
-    ex.response["Error"]["Code"].should.contain("UnknownResourceException")
-    ex.response["Error"]["Message"].should.equal(
-        f"ResourceShare arn:aws:ram:us-east-1:{ACCOUNT_ID}:resource-share/not-existing could not be found."
+    assert ex.operation_name == "UpdateResourceShare"
+    assert ex.response["ResponseMetadata"]["HTTPStatusCode"] == 400
+    assert "UnknownResourceException" in ex.response["Error"]["Code"]
+    assert ex.response["Error"]["Message"] == (
+        f"ResourceShare arn:aws:ram:us-east-1:{ACCOUNT_ID}"
+        ":resource-share/not-existing could not be found."
     )
 
 
@@ -297,14 +315,14 @@ def test_delete_resource_share():
     response = client.delete_resource_share(resourceShareArn=arn)
 
     # then
-    response["returnValue"].should.be.ok
+    assert response["returnValue"] is True
 
     response = client.get_resource_shares(resourceOwner="SELF")
-    response["resourceShares"].should.have.length_of(1)
+    assert len(response["resourceShares"]) == 1
     resource = response["resourceShares"][0]
-    resource["status"].should.equal("DELETED")
+    assert resource["status"] == "DELETED"
     creation_time = resource["creationTime"]
-    resource["lastUpdatedTime"].should.be.greater_than(creation_time)
+    assert resource["lastUpdatedTime"] > creation_time
 
 
 @mock_ram
@@ -319,11 +337,12 @@ def test_delete_resource_share_errors():
             resourceShareArn=f"arn:aws:ram:us-east-1:{ACCOUNT_ID}:resource-share/not-existing"
         )
     ex = e.value
-    ex.operation_name.should.equal("DeleteResourceShare")
-    ex.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
-    ex.response["Error"]["Code"].should.contain("UnknownResourceException")
-    ex.response["Error"]["Message"].should.equal(
-        f"ResourceShare arn:aws:ram:us-east-1:{ACCOUNT_ID}:resource-share/not-existing could not be found."
+    assert ex.operation_name == "DeleteResourceShare"
+    assert ex.response["ResponseMetadata"]["HTTPStatusCode"] == 400
+    assert "UnknownResourceException" in ex.response["Error"]["Code"]
+    assert ex.response["Error"]["Message"] == (
+        f"ResourceShare arn:aws:ram:us-east-1:{ACCOUNT_ID}"
+        ":resource-share/not-existing could not be found."
     )
 
 
@@ -339,7 +358,7 @@ def test_enable_sharing_with_aws_organization():
     response = client.enable_sharing_with_aws_organization()
 
     # then
-    response["returnValue"].should.be.ok
+    assert response["returnValue"] is True
 
 
 @mock_ram
@@ -353,11 +372,12 @@ def test_enable_sharing_with_aws_organization_errors():
     with pytest.raises(ClientError) as e:
         client.enable_sharing_with_aws_organization()
     ex = e.value
-    ex.operation_name.should.equal("EnableSharingWithAwsOrganization")
-    ex.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
-    ex.response["Error"]["Code"].should.contain("OperationNotPermittedException")
-    ex.response["Error"]["Message"].should.equal(
+    assert ex.operation_name == "EnableSharingWithAwsOrganization"
+    assert ex.response["ResponseMetadata"]["HTTPStatusCode"] == 400
+    assert "OperationNotPermittedException" in ex.response["Error"]["Code"]
+    assert ex.response["Error"]["Message"] == (
         "Unable to enable sharing with AWS Organizations. "
-        "Received AccessDeniedException from AWSOrganizations with the following error message: "
+        "Received AccessDeniedException from AWSOrganizations with the "
+        "following error message: "
         "You don't have permissions to access this resource."
     )