Skip to content

Commit 81a8314

Browse files
committed
add mock_s3_resource
1 parent 3edad88 commit 81a8314

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: examples/docs_snippets/docs_snippets_tests/conftest.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import boto3
12
import pytest
3+
from moto import mock_s3
24

35
from dagster import file_relative_path
46

@@ -8,6 +10,12 @@ def docs_snippets_folder():
810
return file_relative_path(__file__, "../docs_snippets/")
911

1012

13+
@pytest.fixture
14+
def mock_s3_resource():
15+
with mock_s3():
16+
yield boto3.resource("s3", region_name="us-east-1")
17+
18+
1119
@pytest.fixture
1220
def mock_s3_bucket(mock_s3_resource):
1321
yield mock_s3_resource.create_bucket(Bucket="test-bucket")

Diff for: examples/docs_snippets/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
# "'NoneType' object has no attribute 'canvas'" errors in the tests that involve
5151
# Jupyter notebooks
5252
"matplotlib-inline<=0.1.3",
53-
"moto<5.0",
53+
"moto[s3]<5.0",
5454
"numpy",
5555
"pandas",
5656
"pandera",

0 commit comments

Comments
 (0)