← requests  /  tests/__init__.py

1
"""Requests test package initialisation."""
2
3
import warnings
4
5
try:
6
    from urllib3.exceptions import SNIMissingWarning
7
8
    # urllib3 1.x sets SNIMissingWarning to only go off once,
9
    # while this test suite requires it to always fire
10
    # so that it occurs during test_requests.test_https_warnings
11
    warnings.simplefilter("always", SNIMissingWarning)
12
except ImportError:
13
    # urllib3 2.0 removed that warning and errors out instead
14
    SNIMissingWarning = None
15