Skip to content

Commit

Permalink
Update botocore tests. (#1051)
Browse files Browse the repository at this point in the history
* Update moto decorators in tests.

* Remove py27 botocore dependencies.

* Drop testing for Python 3.7
  • Loading branch information
umaannamalai authored and hmstepanek committed Jan 31, 2024
1 parent 8a6301c commit 9ffd241
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 21 deletions.
4 changes: 2 additions & 2 deletions tests/external_botocore/test_boto3_iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -62,7 +62,7 @@
background_task=True,
)
@background_task()
@moto.mock_iam
@mock_aws
def test_iam():
iam = boto3.client(
"iam",
Expand Down
4 changes: 2 additions & 2 deletions tests/external_botocore/test_boto3_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -81,7 +81,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",
Expand Down
6 changes: 3 additions & 3 deletions tests/external_botocore/test_boto3_sns.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -53,7 +53,7 @@
background_task=True,
)
@background_task()
@moto.mock_sns
@mock_aws
def test_publish_to_sns_topic(topic_argument):
conn = boto3.client(
"sns",
Expand Down Expand Up @@ -82,7 +82,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",
Expand Down
4 changes: 2 additions & 2 deletions tests/external_botocore/test_botocore_dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -74,7 +74,7 @@
background_task=True,
)
@background_task()
@moto.mock_dynamodb
@mock_aws
def test_dynamodb():
session = botocore.session.get_session()
client = session.create_client(
Expand Down
4 changes: 2 additions & 2 deletions tests/external_botocore/test_botocore_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -63,7 +63,7 @@
background_task=True,
)
@background_task()
@moto.mock_ec2
@mock_aws
def test_ec2():
session = botocore.session.get_session()
client = session.create_client(
Expand Down
4 changes: 2 additions & 2 deletions tests/external_botocore/test_botocore_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -77,7 +77,7 @@
background_task=True,
)
@background_task()
@moto.mock_s3
@mock_aws
def test_s3():
session = botocore.session.get_session()
client = session.create_client(
Expand Down
6 changes: 3 additions & 3 deletions tests/external_botocore/test_botocore_sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -79,7 +79,7 @@
background_task=True,
)
@background_task()
@moto.mock_sqs
@mock_aws
def test_sqs():
session = botocore.session.get_session()
client = session.create_client(
Expand Down Expand Up @@ -127,7 +127,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(
Expand Down
8 changes: 3 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ envlist =
python-cross_agent-{py27,py37,py38,py39,py310,py311,py312}-{with,without}_extensions,
python-cross_agent-pypy27-without_extensions,
python-datastore_sqlite-{py27,py37,py38,py39,py310,py311,py312,pypy27,pypy38},
python-external_botocore-{py37,py38,py39,py310,py311,py312}-botocorelatest,
python-external_botocore-{py311}-botocore128,
python-external_botocore-{py38,py39,py310,py311,py312}-botocorelatest,
python-external_botocore-py311-botocore128,
python-external_botocore-py310-botocore0125,
python-external_feedparser-py27-feedparser{05,06},
python-external_http-{py27,py37,py38,py39,py310,py311,py312,pypy27},
Expand Down Expand Up @@ -254,9 +254,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-{py38,py39,py310,py311,py312}: moto
external_feedparser-feedparser05: feedparser<6
external_feedparser-feedparser06: feedparser<7
external_httplib2: httplib2<1.0
Expand Down

0 comments on commit 9ffd241

Please sign in to comment.