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

support moto 5.x #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pyarrow = "14.0.2" # various test outputs are sensitive to this
pylint = "^3.0.3"
pytest = "^7.4.3"
pytest-mock = "^3.12.0"
moto = "^4.2.12"
moto = ">=4.2.12 <6"
wheel = "^0.42.0"
twine = "^4.0.2"

Expand Down
14 changes: 8 additions & 6 deletions tests/fixtures/aws.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import boto3
from moto import mock_s3
import pytest

try:
# Moto 4.x
from moto import mock_s3
except ImportError:
# Moto 5.x
from moto import mock_aws as mock_s3

@pytest.fixture
def aws_session():
mock_s3_server = mock_s3()
mock_s3_server.start()
yield boto3.Session()
mock_s3_server.stop()

with mock_s3():
yield boto3.Session()

@pytest.fixture
def aws_s3_bucket(aws_session):
Expand Down
Loading