Skip to content

Commit 9f668ee

Browse files
bnavigatorBorda
andauthored
Upgrade tests to moto v5 (#779)
* Replace mock_s3 with mock_aws (Moto 5) * Pin to moto 5.x * No tilde notation Co-authored-by: Jirka Borovec <[email protected]> --------- Co-authored-by: Jirka Borovec <[email protected]>
1 parent a2f4f2d commit 9f668ee

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

papermill/tests/test_s3.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import boto3
66
import moto
77
import pytest
8-
from moto import mock_s3
8+
from moto import mock_aws
99

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

@@ -138,7 +138,7 @@ def test_key_defaults():
138138
assert k1.is_prefix is False
139139

140140

141-
@mock_s3
141+
@mock_aws
142142
def test_s3_defaults():
143143
s1 = S3()
144144
s2 = S3()
@@ -164,8 +164,8 @@ def test_s3_defaults():
164164

165165
@pytest.fixture(scope="function")
166166
def s3_client():
167-
mock_s3 = moto.mock_s3()
168-
mock_s3.start()
167+
mock_aws = moto.mock_aws()
168+
mock_aws.start()
169169

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

183183

184184
def test_s3_read(s3_client):

requirements/dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ google_compute_engine # Need this because boto has issues with dynamic package l
66
ipython>=5.0
77
ipywidgets
88
notebook
9-
moto <5.0.0
9+
moto >= 5.0.0,<5.1.0
1010
pytest>=4.1
1111
pytest-cov>=2.6.1
1212
pytest-mock>=1.10

0 commit comments

Comments
 (0)