File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1+ from distutils .version import LooseVersion
12import os
23
34import pytest
@@ -40,17 +41,18 @@ def s3_resource(tips_file, jsonl_file):
4041 """
4142 pytest .importorskip ('s3fs' )
4243 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" )
4350
4451 # temporary workaround as moto fails for botocore >= 1.11 otherwise
4552 # see https://github.com/spulec/moto/issues/1924 & 1952
4653 os .environ .setdefault ("AWS_ACCESS_KEY_ID" , "foobar_key" )
4754 os .environ .setdefault ("AWS_SECRET_ACCESS_KEY" , "foobar_secret" )
4855
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" )
5456 moto = pytest .importorskip ('moto' )
5557
5658 test_s3_files = [
@@ -83,3 +85,5 @@ def add_tips_files(bucket_name):
8385 yield conn
8486 finally :
8587 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