requests test package initialisation import warnings try from urllib3 exceptions import snimissingwarning urllib3 1 x sets snimissingwarning to only go off once while this test suite requires it to always fire so that it occurs during testrequests testhttpswarnings warnings simplefilteralways snimissingwarning except importerror urllib3 2 0 removed that warning and errors out instead snimissingwarning none urllib3 1 x sets snimissingwarning to only go off once while this test suite requires it to always fire so that it occurs during test_requests test_https_warnings urllib3 2 0 removed that warning and errors out instead
import warnings

try:
    from urllib3.exceptions import SNIMissingWarning

    
    
    
    warnings.simplefilter("always", SNIMissingWarning)
except ImportError:
    
    SNIMissingWarning = None