Skip to content

Commit

Permalink
Replace mock_s3 with mock_aws (Moto 5)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnavigator authored Feb 14, 2024
1 parent fc6d363 commit 7795b90
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions papermill/tests/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import boto3
import moto
import pytest
from moto import mock_s3
from moto import mock_aws

from ..s3 import S3, Bucket, Key, Prefix

Expand Down Expand Up @@ -138,7 +138,7 @@ def test_key_defaults():
assert k1.is_prefix is False


@mock_s3
@mock_aws
def test_s3_defaults():
s1 = S3()
s2 = S3()
Expand All @@ -164,8 +164,8 @@ def test_s3_defaults():

@pytest.fixture(scope="function")
def s3_client():
mock_s3 = moto.mock_s3()
mock_s3.start()
mock_aws = moto.mock_aws()
mock_aws.start()

client = boto3.client('s3')
client.create_bucket(Bucket=test_bucket_name, CreateBucketConfiguration={'LocationConstraint': 'us-west-2'})
Expand All @@ -178,7 +178,7 @@ def s3_client():
client.delete_object(Bucket=test_bucket_name, Key=test_empty_file_path)
except Exception:
pass
mock_s3.stop()
mock_aws.stop()


def test_s3_read(s3_client):
Expand Down

0 comments on commit 7795b90

Please sign in to comment.