-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CI for boto: fix errors; add coverage; add skip for uncatchable ResourceWarning #23731
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5c5c5fa
CI/DEPS: fix boto errors and ResourceWarning; raise botocore min-ver
h-vetinari 488d767
Merge remote-tracking branch 'upstream/master' into fix_resource_warn
h-vetinari 186b215
Merge remote-tracking branch 'upstream/master' into fix_resource_warn
h-vetinari 7682581
Skip old botocore; don't skip on moto; undo env vars in finally
h-vetinari 5979389
Try fix for moto import
h-vetinari 5ce301d
Merge remote-tracking branch 'upstream/master' into fix_resource_warn
h-vetinari 49ff454
Install moto through pip
h-vetinari 0b58728
Merge remote-tracking branch 'upstream/master' into fix_resource_warn
h-vetinari eb1f65b
Add context manager for environment variables
h-vetinari ae0821d
Merge remote-tracking branch 'upstream/master' into fix_resource_warn
h-vetinari abb5d6a
Merge remote-tracking branch 'upstream/master' into fix_resource_warn
h-vetinari f660e40
Add dependencies in environment.yml
h-vetinari b532696
also change requirements-dev.txt
h-vetinari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
from pandas.io.parsers import read_csv | ||
|
||
|
||
|
@@ -37,6 +40,12 @@ def s3_resource(tips_file, jsonl_file): | |
""" | ||
pytest.importorskip('s3fs') | ||
boto3 = pytest.importorskip('boto3') | ||
|
||
# temporary workaround as moto fails for botocore >= 1.11 otherwise | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is affecting global state. can you remove these in the finally (or use a context manager) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
# see https://github.com/spulec/moto/issues/1924 & 1952 | ||
os.environ.setdefault("AWS_ACCESS_KEY_ID", "foobar_key") | ||
os.environ.setdefault("AWS_SECRET_ACCESS_KEY", "foobar_secret") | ||
|
||
# GH-24092. See if boto.plugin skips the test or fails. | ||
try: | ||
pytest.importorskip("boto.plugin") | ||
|
@@ -59,7 +68,6 @@ def add_tips_files(bucket_name): | |
Body=f) | ||
|
||
try: | ||
|
||
s3 = moto.mock_s3() | ||
s3.start() | ||
|
||
|
@@ -73,7 +81,5 @@ def add_tips_files(bucket_name): | |
conn.create_bucket(Bucket='cant_get_it', ACL='private') | ||
add_tips_files('cant_get_it') | ||
yield conn | ||
except: # noqa: flake8 | ||
pytest.skip("failure to use s3 resource") | ||
finally: | ||
s3.stop() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.