diff --git a/papermill/tests/test_s3.py b/papermill/tests/test_s3.py index c8ac4f6a..1e4b9e68 100644 --- a/papermill/tests/test_s3.py +++ b/papermill/tests/test_s3.py @@ -2,6 +2,7 @@ import os.path import pytest +import boto3 import moto from moto import mock_s3 @@ -176,14 +177,14 @@ def test_split_error(): read_from_gen = lambda g: "\n".join(g) - -@pytest.yield_fixture +@pytest.yield_fixture(scope="function") def s3_client(): mock_s3 = moto.mock_s3() mock_s3.start() - import boto3 - client = boto3.client('s3') + client = boto3.client('s3', + aws_access_key_id='fake', + aws_secret_access_key= 'fake') client.create_bucket(Bucket=test_bucket_name) client.put_object(Bucket=test_bucket_name, Key=test_file_path, Body=test_nb_content) yield S3()