diff --git a/tests/integrations/trytond_wsgi/test_trytond.py b/tests/integrations/trytond_wsgi/test_trytond.py index 19f2135d05..9af0aa8c58 100644 --- a/tests/integrations/trytond_wsgi/test_trytond.py +++ b/tests/integrations/trytond_wsgi/test_trytond.py @@ -9,6 +9,7 @@ from trytond.wsgi import app as trytond_app from werkzeug.test import Client +import sentry_sdk from sentry_sdk.integrations.trytond import TrytondWSGIIntegration from tests.conftest import unpack_werkzeug_response @@ -121,12 +122,13 @@ def _(app, request, e): assert data == dict(id=42, error=["UserError", ["Sentry error.", "foo", None]]) -def test_span_origin(sentry_init, app, capture_events, get_client): +def test_span_origin(sentry_init, app, capture_items, get_client): sentry_init( integrations=[TrytondWSGIIntegration()], traces_sample_rate=1.0, + trace_lifecycle="stream", ) - events = capture_events() + items = capture_items("span") @app.route("/something") def _(request): @@ -135,6 +137,9 @@ def _(request): client = get_client() client.get("/something") - (event,) = events + sentry_sdk.flush() - assert event["contexts"]["trace"]["origin"] == "auto.http.trytond_wsgi" + (item,) = items + span = item.payload + + assert span["attributes"]["sentry.origin"] == "auto.http.trytond_wsgi"