diff --git a/sentry_sdk/transport.py b/sentry_sdk/transport.py index e5c39c48e4..1f83b5d01f 100644 --- a/sentry_sdk/transport.py +++ b/sentry_sdk/transport.py @@ -12,7 +12,6 @@ import urllib3 import certifi -import sentry_sdk from sentry_sdk.consts import EndpointType from sentry_sdk.utils import Dsn, logger, capture_internal_exceptions from sentry_sdk.worker import BackgroundWorker @@ -231,9 +230,6 @@ def __init__( proxy_headers=options["proxy_headers"], ) - # Backwards compatibility for deprecated `self.hub_class` attribute - self._hub_cls = sentry_sdk.Hub - def record_lost_event( self, reason, # type: str @@ -604,30 +600,6 @@ def kill(self): logger.debug("Killing HTTP transport") self._worker.kill() - @staticmethod - def _warn_hub_cls(): - # type: () -> None - """Convenience method to warn users about the deprecation of the `hub_cls` attribute.""" - warnings.warn( - "The `hub_cls` attribute is deprecated and will be removed in a future release.", - DeprecationWarning, - stacklevel=3, - ) - - @property - def hub_cls(self): - # type: () -> type[sentry_sdk.Hub] - """DEPRECATED: This attribute is deprecated and will be removed in a future release.""" - HttpTransport._warn_hub_cls() - return self._hub_cls - - @hub_cls.setter - def hub_cls(self, value): - # type: (type[sentry_sdk.Hub]) -> None - """DEPRECATED: This attribute is deprecated and will be removed in a future release.""" - HttpTransport._warn_hub_cls() - self._hub_cls = value - class _FunctionTransport(Transport): """ diff --git a/tests/test_transport.py b/tests/test_transport.py index 2e2ad3c4cd..d4522de942 100644 --- a/tests/test_transport.py +++ b/tests/test_transport.py @@ -18,13 +18,11 @@ capture_message, isolation_scope, get_isolation_scope, - Hub, ) from sentry_sdk.envelope import Envelope, Item, parse_json from sentry_sdk.transport import ( KEEP_ALIVE_SOCKET_OPTIONS, _parse_rate_limits, - HttpTransport, ) from sentry_sdk.integrations.logging import LoggingIntegration, ignore_logger @@ -649,24 +647,6 @@ def test_metric_bucket_limits_with_all_namespaces( ] -def test_hub_cls_backwards_compat(): - class TestCustomHubClass(Hub): - pass - - transport = HttpTransport( - defaultdict(lambda: None, {"dsn": "https://123abc@example.com/123"}) - ) - - with pytest.deprecated_call(): - assert transport.hub_cls is Hub - - with pytest.deprecated_call(): - transport.hub_cls = TestCustomHubClass - - with pytest.deprecated_call(): - assert transport.hub_cls is TestCustomHubClass - - @pytest.mark.parametrize("quantity", (1, 2, 10)) def test_record_lost_event_quantity(capturing_server, make_client, quantity): client = make_client()