diff --git a/tests/integrations/starlette/test_starlette.py b/tests/integrations/starlette/test_starlette.py index fd47895f5a..22ed10b7cb 100644 --- a/tests/integrations/starlette/test_starlette.py +++ b/tests/integrations/starlette/test_starlette.py @@ -659,9 +659,9 @@ def test_middleware_spans(sentry_init, capture_events): "AuthenticationMiddleware", "ExceptionMiddleware", "AuthenticationMiddleware", # 'op': 'middleware.starlette.send' - "ServerErrorMiddleware", # 'op': 'middleware.starlette.send' "AuthenticationMiddleware", # 'op': 'middleware.starlette.send' "ServerErrorMiddleware", # 'op': 'middleware.starlette.send' + "ServerErrorMiddleware", # 'op': 'middleware.starlette.send' ] assert len(transaction_event["spans"]) == len(expected_middleware_spans) @@ -736,23 +736,23 @@ def test_middleware_callback_spans(sentry_init, capture_events): }, { "op": "middleware.starlette.send", - "description": "ServerErrorMiddleware.__call__.._send", - "tags": {"starlette.middleware_name": "SampleMiddleware"}, + "description": "SampleMiddleware.__call__..do_stuff", + "tags": {"starlette.middleware_name": "ExceptionMiddleware"}, }, { "op": "middleware.starlette.send", - "description": "SentryAsgiMiddleware._run_app.._sentry_wrapped_send", - "tags": {"starlette.middleware_name": "ServerErrorMiddleware"}, + "description": "ServerErrorMiddleware.__call__.._send", + "tags": {"starlette.middleware_name": "SampleMiddleware"}, }, { "op": "middleware.starlette.send", - "description": "SampleMiddleware.__call__..do_stuff", - "tags": {"starlette.middleware_name": "ExceptionMiddleware"}, + "description": "ServerErrorMiddleware.__call__.._send", + "tags": {"starlette.middleware_name": "SampleMiddleware"}, }, { "op": "middleware.starlette.send", - "description": "ServerErrorMiddleware.__call__.._send", - "tags": {"starlette.middleware_name": "SampleMiddleware"}, + "description": "SentryAsgiMiddleware._run_app.._sentry_wrapped_send", + "tags": {"starlette.middleware_name": "ServerErrorMiddleware"}, }, { "op": "middleware.starlette.send", @@ -830,16 +830,16 @@ def test_middleware_partial_receive_send(sentry_init, capture_events): "description": "ServerErrorMiddleware.__call__.._send", "tags": {"starlette.middleware_name": "SamplePartialReceiveSendMiddleware"}, }, - { - "op": "middleware.starlette.send", - "description": "SentryAsgiMiddleware._run_app.._sentry_wrapped_send", - "tags": {"starlette.middleware_name": "ServerErrorMiddleware"}, - }, { "op": "middleware.starlette", "description": "ExceptionMiddleware", "tags": {"starlette.middleware_name": "ExceptionMiddleware"}, }, + { + "op": "middleware.starlette.send", + "description": "SentryAsgiMiddleware._run_app.._sentry_wrapped_send", + "tags": {"starlette.middleware_name": "ServerErrorMiddleware"}, + }, { "op": "middleware.starlette.send", "description": "functools.partial(.my_send at ", @@ -886,13 +886,13 @@ def test_active_thread_id(sentry_init, capture_envelopes, teardown_profiling, en sentry_init( traces_sample_rate=1.0, profiles_sample_rate=1.0, + integrations=[StarletteIntegration()], ) app = starlette_app_factory() - asgi_app = SentryAsgiMiddleware(app) envelopes = capture_envelopes() - client = TestClient(asgi_app) + client = TestClient(app) response = client.get(endpoint) assert response.status_code == 200 @@ -1244,9 +1244,7 @@ def test_transaction_http_method_default(sentry_init, capture_events): """ sentry_init( traces_sample_rate=1.0, - integrations=[ - StarletteIntegration(), - ], + integrations=[StarletteIntegration()], ) events = capture_events()