File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1818import warnings
1919
2020import pytest
21+ import requests
22+ import urllib3
2123
2224from elastic_transport import Transport
2325
2426
2527@pytest .mark .parametrize ("node_class" , ["urllib3" , "requests" ])
2628def test_simple_request (node_class , https_server_ip_node_config ):
29+ # when testing minimum urllib3 and requests dependencies, we disable
30+ # the deprecation warning for ssl.match_hostname()
31+ silence_ssl_deprecation = (
32+ node_class == "urllib3" and urllib3 .__version__ == "1.26.2"
33+ ) or (node_class == "requests" and requests .__version__ == "2.26.0" )
34+
2735 with warnings .catch_warnings ():
2836 warnings .simplefilter ("error" )
37+ if silence_ssl_deprecation :
38+ warnings .filterwarnings (
39+ "ignore" , ".*match_hostname.*deprecated" , DeprecationWarning
40+ )
2941
3042 t = Transport ([https_server_ip_node_config ], node_class = node_class )
3143
You can’t perform that action at this time.
0 commit comments