From 46fe396364c871c84b4ea2f33cec8fc43f17b66a Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Thu, 27 Aug 2026 13:53:05 +0200 Subject: [PATCH 1/2] chore(trytond): Adapt test to span streamin --- tests/integrations/trytond_wsgi/test_trytond.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/integrations/trytond_wsgi/test_trytond.py b/tests/integrations/trytond_wsgi/test_trytond.py index 19f2135d05..1a1f5ada03 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() @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" From 54c6140b165438aa92da9f252024dae3d1bf0eac Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Thu, 27 Aug 2026 14:16:03 +0200 Subject: [PATCH 2/2] . --- tests/integrations/trytond_wsgi/test_trytond.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integrations/trytond_wsgi/test_trytond.py b/tests/integrations/trytond_wsgi/test_trytond.py index 1a1f5ada03..9af0aa8c58 100644 --- a/tests/integrations/trytond_wsgi/test_trytond.py +++ b/tests/integrations/trytond_wsgi/test_trytond.py @@ -128,7 +128,7 @@ def test_span_origin(sentry_init, app, capture_items, get_client): traces_sample_rate=1.0, trace_lifecycle="stream", ) - items = capture_items() + items = capture_items("span") @app.route("/something") def _(request):