-
-
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
failure to mock aws auth - NoCredentialsError #2069
Comments
I'm having similar issues as well, even adding something like Versions
|
Update, creating a bucket fails with permission denied errors.
Actual AWS credentials are working file, i.e.
error and backtraceTL;DR:
|
It's possible this could be related to using boto outside a mock context anywhere in the project. Seems like if any modules anywhere in the project library or in tests initialize a |
See #1926 for a possible solution - you can call |
For gitlab, creating fake values for the AWS credentials as environment variables worked OK. All the code is careful not to create or retain any module vars/consts, class or instance vars that retain instantiation of any boto3 resources on imports. All instantiation of boto3 resources is lazy. |
Can someone please test this PR? #2285 |
Going to close given #2285, but feel free to reopen if this still is happening. |
Forgive me for assuming the
@mock_s3
decorator magically takes care of everything or for missing some RTD about this; happy to be corrected and pointed to the right RTD page.On gitlab CI pipeline runner, there are no AWS credentials available and the @mock_s3 decorator is not mocking the credentials correctly, resulting in a test failure like:
The text was updated successfully, but these errors were encountered: