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

Mocked AWS fixture scoping does not appear to be working properly #57

Open
kostaleonard opened this issue Apr 9, 2022 · 0 comments
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kostaleonard
Copy link
Owner

The mocked AWS fixture scoping is currently set to session, which prevents any tests from reaching out to S3, even those not requesting the fixture. This is not currently an issue because all of our S3 tests are mocked, but in the future they may not be. The mocked AWS fixture should have function level scope, which would cause a new mocked bucket to be created for every test. However, this does not appear to work for some reason. Tests will pass when run individually, but tests in and between modules will fail with PublicationPathAlreadyExistsError. Despite our debugging using fs.ls() within tests to verify that the mocked buckets are empty, moto believes otherwise (perhaps because it relies on boto3, which does not flush changes to buckets immediately after every operation).

If we introduce tests that cannot or should not use a mocked S3 bucket, we will need to decrease the fixture's scope to function level and devise strategies to repair failing tests.

@kostaleonard kostaleonard added the bug Something isn't working label Apr 9, 2022
@kostaleonard kostaleonard added this to the Third release milestone Apr 9, 2022
@kostaleonard kostaleonard self-assigned this Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant