From 497a6ae64c19512ce079e64b1dcde1ce99719f03 Mon Sep 17 00:00:00 2001 From: Uma Annamalai Date: Mon, 29 Jan 2024 11:40:49 -0800 Subject: [PATCH 1/3] Update moto decorators in tests. --- tests/external_botocore/test_boto3_iam.py | 4 ++-- tests/external_botocore/test_boto3_s3.py | 4 ++-- tests/external_botocore/test_boto3_sns.py | 6 +++--- tests/external_botocore/test_botocore_dynamodb.py | 4 ++-- tests/external_botocore/test_botocore_ec2.py | 4 ++-- tests/external_botocore/test_botocore_s3.py | 4 ++-- tests/external_botocore/test_botocore_sqs.py | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/external_botocore/test_boto3_iam.py b/tests/external_botocore/test_boto3_iam.py index 1bd05669a4..5f85cf3f36 100644 --- a/tests/external_botocore/test_boto3_iam.py +++ b/tests/external_botocore/test_boto3_iam.py @@ -16,7 +16,7 @@ import uuid import boto3 -import moto +from moto import mock_aws from testing_support.fixtures import dt_enabled from testing_support.validators.validate_span_events import validate_span_events from testing_support.validators.validate_transaction_metrics import ( @@ -68,7 +68,7 @@ background_task=True, ) @background_task() -@moto.mock_iam +@mock_aws def test_iam(): iam = boto3.client( "iam", diff --git a/tests/external_botocore/test_boto3_s3.py b/tests/external_botocore/test_boto3_s3.py index 00972c25b1..5f98207ecf 100644 --- a/tests/external_botocore/test_boto3_s3.py +++ b/tests/external_botocore/test_boto3_s3.py @@ -17,7 +17,7 @@ import boto3 import botocore -import moto +from moto import mock_aws from testing_support.fixtures import dt_enabled from testing_support.validators.validate_span_events import validate_span_events from testing_support.validators.validate_transaction_metrics import ( @@ -87,7 +87,7 @@ "test_boto3_s3:test_s3", scoped_metrics=_s3_scoped_metrics, rollup_metrics=_s3_rollup_metrics, background_task=True ) @background_task() -@moto.mock_s3 +@mock_aws def test_s3(): client = boto3.client( "s3", diff --git a/tests/external_botocore/test_boto3_sns.py b/tests/external_botocore/test_boto3_sns.py index 307aeed84a..5553faca1e 100644 --- a/tests/external_botocore/test_boto3_sns.py +++ b/tests/external_botocore/test_boto3_sns.py @@ -15,8 +15,8 @@ import sys import boto3 -import moto import pytest +from moto import mock_aws from testing_support.fixtures import dt_enabled from testing_support.validators.validate_span_events import validate_span_events from testing_support.validators.validate_transaction_metrics import ( @@ -59,7 +59,7 @@ background_task=True, ) @background_task() -@moto.mock_sns +@mock_aws def test_publish_to_sns_topic(topic_argument): conn = boto3.client( "sns", @@ -88,7 +88,7 @@ def test_publish_to_sns_topic(topic_argument): background_task=True, ) @background_task() -@moto.mock_sns +@mock_aws def test_publish_to_sns_phone(): conn = boto3.client( "sns", diff --git a/tests/external_botocore/test_botocore_dynamodb.py b/tests/external_botocore/test_botocore_dynamodb.py index 8c43ed5c45..8670b9caf6 100644 --- a/tests/external_botocore/test_botocore_dynamodb.py +++ b/tests/external_botocore/test_botocore_dynamodb.py @@ -16,7 +16,7 @@ import uuid import botocore.session -import moto +from moto import mock_aws from testing_support.fixtures import dt_enabled from testing_support.validators.validate_span_events import validate_span_events from testing_support.validators.validate_transaction_metrics import ( @@ -81,7 +81,7 @@ background_task=True, ) @background_task() -@moto.mock_dynamodb +@mock_aws def test_dynamodb(): session = botocore.session.get_session() client = session.create_client( diff --git a/tests/external_botocore/test_botocore_ec2.py b/tests/external_botocore/test_botocore_ec2.py index e43744f6c8..957bda6efa 100644 --- a/tests/external_botocore/test_botocore_ec2.py +++ b/tests/external_botocore/test_botocore_ec2.py @@ -16,7 +16,7 @@ import uuid import botocore.session -import moto +from moto import mock_aws from testing_support.fixtures import dt_enabled from testing_support.validators.validate_span_events import validate_span_events from testing_support.validators.validate_transaction_metrics import ( @@ -69,7 +69,7 @@ background_task=True, ) @background_task() -@moto.mock_ec2 +@mock_aws def test_ec2(): session = botocore.session.get_session() client = session.create_client( diff --git a/tests/external_botocore/test_botocore_s3.py b/tests/external_botocore/test_botocore_s3.py index 5bd2feab1c..f0c2bd376b 100644 --- a/tests/external_botocore/test_botocore_s3.py +++ b/tests/external_botocore/test_botocore_s3.py @@ -17,7 +17,7 @@ import botocore import botocore.session -import moto +from moto import mock_aws from testing_support.fixtures import dt_enabled from testing_support.validators.validate_span_events import validate_span_events from testing_support.validators.validate_transaction_metrics import ( @@ -84,7 +84,7 @@ background_task=True, ) @background_task() -@moto.mock_s3 +@mock_aws def test_s3(): session = botocore.session.get_session() client = session.create_client( diff --git a/tests/external_botocore/test_botocore_sqs.py b/tests/external_botocore/test_botocore_sqs.py index 6a96614e54..05a178eb7a 100644 --- a/tests/external_botocore/test_botocore_sqs.py +++ b/tests/external_botocore/test_botocore_sqs.py @@ -16,8 +16,8 @@ import uuid import botocore.session -import moto import pytest +from moto import mock_aws from testing_support.fixtures import dt_enabled from testing_support.validators.validate_span_events import validate_span_events from testing_support.validators.validate_transaction_metrics import ( @@ -85,7 +85,7 @@ background_task=True, ) @background_task() -@moto.mock_sqs +@mock_aws def test_sqs(): session = botocore.session.get_session() client = session.create_client( @@ -133,7 +133,7 @@ def test_sqs(): background_task=True, ) @background_task() -@moto.mock_sqs +@mock_aws def test_sqs_malformed(): session = botocore.session.get_session() client = session.create_client( From 924e14762e4d985be84fe1e78cce3f3889b69ed6 Mon Sep 17 00:00:00 2001 From: Uma Annamalai Date: Mon, 29 Jan 2024 12:00:38 -0800 Subject: [PATCH 2/3] Remove py27 botocore dependencies. --- tox.ini | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 1497c6babb..f82bda835f 100644 --- a/tox.ini +++ b/tox.ini @@ -250,9 +250,7 @@ deps = external_botocore-botocorelatest: boto3 external_botocore-botocore128: botocore<1.29 external_botocore-botocore0125: botocore<1.26 - external_botocore-{py37,py38,py39,py310,py311,py312}: moto[awslambda,ec2,iam,sqs] - external_botocore-py27: rsa<4.7.1 - external_botocore-py27: moto[awslambda,ec2,iam,sqs]<2.0 + external_botocore-{py37,py38,py39,py310,py311,py312}: moto external_feedparser-feedparser05: feedparser<6 external_feedparser-feedparser06: feedparser<7 external_httplib2: httplib2<1.0 From a977d80afdcb032c20cd10a069f213030f26a1a3 Mon Sep 17 00:00:00 2001 From: Uma Annamalai Date: Mon, 29 Jan 2024 12:35:38 -0800 Subject: [PATCH 3/3] Drop testing for Python 3.7 --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index f82bda835f..d34bfa3066 100644 --- a/tox.ini +++ b/tox.ini @@ -101,7 +101,7 @@ envlist = python-cross_agent-pypy27-without_extensions, python-datastore_sqlite-{py27,py37,py38,py39,py310,py311,py312,pypy27,pypy38}, python-external_botocore-py311-botocore128, - python-external_botocore-{py37,py38,py39,py310,py311,py312}-botocorelatest, + python-external_botocore-{py38,py39,py310,py311,py312}-botocorelatest, python-external_botocore-py310-botocore0125, python-external_feedparser-py27-feedparser{05,06}, python-external_http-{py27,py37,py38,py39,py310,py311,py312,pypy27}, @@ -250,7 +250,7 @@ deps = external_botocore-botocorelatest: boto3 external_botocore-botocore128: botocore<1.29 external_botocore-botocore0125: botocore<1.26 - external_botocore-{py37,py38,py39,py310,py311,py312}: moto + external_botocore-{py38,py39,py310,py311,py312}: moto external_feedparser-feedparser05: feedparser<6 external_feedparser-feedparser06: feedparser<7 external_httplib2: httplib2<1.0