# Path: geopy/adapters.py
# class AdapterHTTPError(IOError):
#     """An exception which must be raised by adapters when an HTTP response
#     with a non-successful status code has been received.
# 
#     Base Geocoder class translates this exception to an instance of
#     :class:`geopy.exc.GeocoderServiceError`.
# 
#     """
# 
#     def __init__(self, message, *, status_code, headers, text):
#         """
# 
#         :param str message: Standard exception message.
#         :param int status_code: HTTP status code.
#         :param dict headers: HTTP response readers. A mapping object
#             with lowercased or case-insensitive keys.
# 
#             .. versionadded:: 2.2
#         :param str text: HTTP body text.
#         """
#         self.status_code = status_code
#         self.headers = headers
#         self.text = text
#         super().__init__(message)
# 
# class BaseAsyncAdapter(BaseAdapter):
#     """Base class for asynchronous adapters.
# 
#     See also: :ref:`Async Mode <async_mode>`.
#     """
# 
#     async def __aenter__(self):
#         return self
# 
#     async def __aexit__(self, exc_type, exc_val, exc_tb):
#         pass
# 
# class BaseSyncAdapter(BaseAdapter):
#     """Base class for synchronous adapters.
#     """
# 
#     def __enter__(self):
#         return self
# 
#     def __exit__(self, exc_type, exc_val, exc_tb):
#         pass
# 
# Path: geopy/geocoders/base.py
# _DEFAULT_ADAPTER_CLASS = next(
#     adapter_cls
#     for adapter_cls in (RequestsAdapter, URLLibAdapter,)
#     if adapter_cls.is_available
# )


import asyncio
import atexit
import contextlib
import importlib
import inspect
import os
import types
import pytest
import geopy.geocoders
from collections import defaultdict
from functools import partial
from statistics import mean, median
from time import sleep
from timeit import default_timer
from unittest.mock import patch
from urllib.parse import urlparse
from geopy.adapters import AdapterHTTPError, BaseAsyncAdapter, BaseSyncAdapter
from geopy.geocoders.base import _DEFAULT_ADAPTER_CLASS
    # https://github.com/pytest-dev/pytest/issues/2704
    # https://stackoverflow.com/a/38806934
    atexit.register(report)


@pytest.fixture(scope='session')
def retries_enabled_session():
    return types.SimpleNamespace(value=True)


@pytest.fixture
def disable_adapter_retries(retries_enabled_session):
    retries_enabled_session.value = False
    yield
    retries_enabled_session.value = True


@pytest.fixture(autouse=True, scope='session')
def patch_adapter(
    requests_monitor, retries_enabled_session, is_internet_access_allowed
):
    """
    Patch the default Adapter to provide the following features:
        - Retry failed requests. Makes test runs more stable.
        - Track statistics with RequestsMonitor.
        - Skip tests requiring Internet access when Internet access is not allowed.
    """

    if default_adapter_is_async:


# Path: geopy/adapters.py
# class AdapterHTTPError(IOError):
#     """An exception which must be raised by adapters when an HTTP response
#     with a non-successful status code has been received.
# 
#     Base Geocoder class translates this exception to an instance of
#     :class:`geopy.exc.GeocoderServiceError`.
# 
#     """
# 
#     def __init__(self, message, *, status_code, headers, text):
#         """
# 
#         :param str message: Standard exception message.
#         :param int status_code: HTTP status code.
#         :param dict headers: HTTP response readers. A mapping object
#             with lowercased or case-insensitive keys.
# 
#             .. versionadded:: 2.2
#         :param str text: HTTP body text.
#         """
#         self.status_code = status_code
#         self.headers = headers
#         self.text = text
#         super().__init__(message)
# 
# class BaseAsyncAdapter(BaseAdapter):
#     """Base class for asynchronous adapters.
# 
#     See also: :ref:`Async Mode <async_mode>`.
#     """
# 
#     async def __aenter__(self):
#         return self
# 
#     async def __aexit__(self, exc_type, exc_val, exc_tb):
#         pass
# 
# class BaseSyncAdapter(BaseAdapter):
#     """Base class for synchronous adapters.
#     """
# 
#     def __enter__(self):
#         return self
# 
#     def __exit__(self, exc_type, exc_val, exc_tb):
#         pass
# 
# Path: geopy/geocoders/base.py
# _DEFAULT_ADAPTER_CLASS = next(
#     adapter_cls
#     for adapter_cls in (RequestsAdapter, URLLibAdapter,)
#     if adapter_cls.is_available
# )


# Path: test/conftest.py
import asyncio
import atexit
import contextlib
import importlib
import inspect
import os
import types
import pytest
import geopy.geocoders
from collections import defaultdict
from functools import partial
from statistics import mean, median
from time import sleep
from timeit import default_timer
from unittest.mock import patch
from urllib.parse import urlparse
from geopy.adapters import AdapterHTTPError, BaseAsyncAdapter, BaseSyncAdapter
from geopy.geocoders.base import _DEFAULT_ADAPTER_CLASS

    # https://github.com/pytest-dev/pytest/issues/2704
    # https://stackoverflow.com/a/38806934
    atexit.register(report)


@pytest.fixture(scope='session')
def retries_enabled_session():
    return types.SimpleNamespace(value=True)


@pytest.fixture
def disable_adapter_retries(retries_enabled_session):
    retries_enabled_session.value = False
    yield
    retries_enabled_session.value = True


@pytest.fixture(autouse=True, scope='session')
def patch_adapter(
    requests_monitor, retries_enabled_session, is_internet_access_allowed
):
    """
    Patch the default Adapter to provide the following features:
        - Retry failed requests. Makes test runs more stable.
        - Track statistics with RequestsMonitor.
        - Skip tests requiring Internet access when Internet access is not allowed.
    """

    if default_adapter_is_async:


        class AdapterProxy(BaseAdapterProxy, BaseAsyncAdapter):