From 2c505f59373ef8e7603ef37be176c0346c49a877 Mon Sep 17 00:00:00 2001 From: Anirban Ray <39331844+yarnabrina@users.noreply.github.com> Date: Mon, 29 Jan 2024 21:01:06 +0530 Subject: [PATCH] fix moto breaking change --- pyproject.toml | 2 +- sktime/utils/tests/test_mlflow_sktime_model_export.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6ceff7f0792..1b1cd0961ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -270,7 +270,7 @@ mlflow_tests = [ "boto3", "botocore", "mlflow", - "moto<5.0.0", + "moto", ] pandas1 = [ "pandas<2.0.0", diff --git a/sktime/utils/tests/test_mlflow_sktime_model_export.py b/sktime/utils/tests/test_mlflow_sktime_model_export.py index 5a8531feed2..9feabc8ffc5 100644 --- a/sktime/utils/tests/test_mlflow_sktime_model_export.py +++ b/sktime/utils/tests/test_mlflow_sktime_model_export.py @@ -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": + 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)