File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change
1
+ from distutils .version import LooseVersion
1
2
import os
2
3
3
4
import pytest
@@ -40,17 +41,18 @@ def s3_resource(tips_file, jsonl_file):
40
41
"""
41
42
pytest .importorskip ('s3fs' )
42
43
boto3 = pytest .importorskip ('boto3' )
44
+ botocore = pytest .importorskip ('botocore' )
45
+
46
+ if LooseVersion (botocore .__version__ ) < LooseVersion ("1.11.0" ):
47
+ # botocore leaks an uncatchable ResourceWarning before 1.11.0;
48
+ # see GH 23731 and https://github.com/boto/botocore/issues/1464
49
+ pytest .skip ("botocore is leaking resources before 1.11.0" )
43
50
44
51
# temporary workaround as moto fails for botocore >= 1.11 otherwise
45
52
# see https://github.com/spulec/moto/issues/1924 & 1952
46
53
os .environ .setdefault ("AWS_ACCESS_KEY_ID" , "foobar_key" )
47
54
os .environ .setdefault ("AWS_SECRET_ACCESS_KEY" , "foobar_secret" )
48
55
49
- # GH-24092. See if boto.plugin skips the test or fails.
50
- try :
51
- pytest .importorskip ("boto.plugin" )
52
- except AttributeError :
53
- raise pytest .skip ("moto/moto error" )
54
56
moto = pytest .importorskip ('moto' )
55
57
56
58
test_s3_files = [
@@ -83,3 +85,5 @@ def add_tips_files(bucket_name):
83
85
yield conn
84
86
finally :
85
87
s3 .stop ()
88
+ os .environ .setdefault ("AWS_ACCESS_KEY_ID" , None )
89
+ os .environ .setdefault ("AWS_SECRET_ACCESS_KEY" , None )
You can’t perform that action at this time.
0 commit comments