Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade tests to moto v5 #779

Merged
merged 3 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ google_compute_engine # Need this because boto has issues with dynamic package l
ipython>=5.0
ipywidgets
notebook
moto <5.0.0
moto ~= 5.0
bnavigator marked this conversation as resolved.
Show resolved Hide resolved
pytest>=4.1
pytest-cov>=2.6.1
pytest-mock>=1.10
Expand Down
Loading