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

[MNT] [BUG] fix moto breaking change by using different mocking methods depending on version #5858

Merged
merged 1 commit into from Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -270,7 +270,7 @@ mlflow_tests = [
"boto3",
"botocore",
"mlflow",
"moto<5.0.0",
"moto",
]
pandas1 = [
"pandas<2.0.0",
Expand Down
7 changes: 6 additions & 1 deletion sktime/utils/tests/test_mlflow_sktime_model_export.py
Expand Up @@ -41,7 +41,12 @@ def mock_s3_bucket():
-------
string with name of mock S3 bucket
"""
with moto.mock_s3():
if moto.__version__ < "5.0.0":
yarnabrina marked this conversation as resolved.
Show resolved Hide resolved
mock_method = moto.mock_s3
else:
mock_method = moto.mock_aws

with mock_method():
bucket_name = "mock-bucket"
my_config = Config(region_name="us-east-1")
s3_client = boto3.client("s3", config=my_config)
Expand Down