-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
moto 1.3.14 breaks boto3 access (again) #3140
Comments
Hi @snimark, that is the expected behaviour, yes. Botocore does not support credential mocking on a client/service basis, so they can only be mocked on a system level. So the moment you use any of the decorators, all boto-calls will use mocked credentials. There is a workaround to un-mock the credentials, as described here: #3111. Another workaround would be to manually start/stop mocking specific services:
Hopefully that's helpful for your usecase? |
Thanks for the reply. I will see about implementing this model of cherry picking the resources to mock in our tests. |
Going to close this issue - please let us know if there are an other questions/issues though! |
I believe this might be a reemergence of a past bug (#2172).
The following code has two duplicate functions, but the second has a
mock_ec2
decorator. Expected behavior would be establishing a mockec2
client object only when using the function with the decorator, but the behavior is that it also impacts the session object (which is intended to use an instance profile).The instance id used in both is an existing instance in my account at the time of the call. The mocked environment making the call to the EC2 instance should fail. It should be the only thing that fails.
Installed via pip3:
Using the Python mocks (not server).
Is this expected behavior? Should the explicit use of a mock for a specific resource impact outside that resource scope?
The text was updated successfully, but these errors were encountered: