diff --git a/tests/test_ssm/test_ssm_boto3.py b/tests/test_ssm/test_ssm_boto3.py index 26db26dcb..bb674fb65 100644 --- a/tests/test_ssm/test_ssm_boto3.py +++ b/tests/test_ssm/test_ssm_boto3.py @@ -34,14 +34,12 @@ def test_delete_parameter(): def test_delete_nonexistent_parameter(): client = boto3.client("ssm", region_name="us-east-1") - try: + with assert_raises(ClientError) as ex: client.delete_parameter(Name="test_noexist") - raise RuntimeError("Should of failed") - except botocore.exceptions.ClientError as err: - err.operation_name.should.equal("DeleteParameter") - err.response["Error"]["Message"].should.equal( - "Parameter test_noexist not found." - ) + ex.exception.response["Error"]["Code"].should.equal("ParameterNotFound") + ex.exception.response["Error"]["Message"].should.equal( + "Parameter test_noexist not found." + ) @mock_ssm