Skip to content

Commit 5c5c5fa

Browse files
committed
CI/DEPS: fix boto errors and ResourceWarning; raise botocore min-ver
1 parent b841374 commit 5c5c5fa

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

ci/deps/travis-36.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ channels:
44
- conda-forge
55
dependencies:
66
- beautifulsoup4
7+
- botocore>=1.11
78
- cython>=0.28.2
89
- dask
910
- fastparquet

ci/deps/travis-37.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ channels:
55
- c3i_test
66
dependencies:
77
- python=3.7
8+
- botocore>=1.11
89
- cython>=0.28.2
910
- numpy
1011
- python-dateutil
@@ -14,3 +15,6 @@ dependencies:
1415
- pytest
1516
- pytest-xdist
1617
- hypothesis>=3.58.0
18+
- s3fs
19+
- pip:
20+
- moto

pandas/tests/io/conftest.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import os
2+
13
import pytest
4+
25
from pandas.io.parsers import read_csv
36

47

@@ -37,6 +40,12 @@ def s3_resource(tips_file, jsonl_file):
3740
"""
3841
pytest.importorskip('s3fs')
3942
boto3 = pytest.importorskip('boto3')
43+
44+
# temporary workaround as moto fails for botocore >= 1.11 otherwise
45+
# see https://github.com/spulec/moto/issues/1924 & 1952
46+
os.environ.setdefault("AWS_ACCESS_KEY_ID", "foobar_key")
47+
os.environ.setdefault("AWS_SECRET_ACCESS_KEY", "foobar_secret")
48+
4049
# GH-24092. See if boto.plugin skips the test or fails.
4150
try:
4251
pytest.importorskip("boto.plugin")
@@ -59,7 +68,6 @@ def add_tips_files(bucket_name):
5968
Body=f)
6069

6170
try:
62-
6371
s3 = moto.mock_s3()
6472
s3.start()
6573

@@ -73,7 +81,5 @@ def add_tips_files(bucket_name):
7381
conn.create_bucket(Bucket='cant_get_it', ACL='private')
7482
add_tips_files('cant_get_it')
7583
yield conn
76-
except: # noqa: flake8
77-
pytest.skip("failure to use s3 resource")
7884
finally:
7985
s3.stop()

0 commit comments

Comments
 (0)