Skip to content

Commit fa11097

Browse files
committed
chore(trytond): Adapt test to span streamin
1 parent 34f3665 commit fa11097

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

tests/integrations/trytond_wsgi/test_trytond.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from trytond.wsgi import app as trytond_app
1010
from werkzeug.test import Client
1111

12+
import sentry_sdk
1213
from sentry_sdk.integrations.trytond import TrytondWSGIIntegration
1314
from tests.conftest import unpack_werkzeug_response
1415

@@ -121,12 +122,13 @@ def _(app, request, e):
121122
assert data == dict(id=42, error=["UserError", ["Sentry error.", "foo", None]])
122123

123124

124-
def test_span_origin(sentry_init, app, capture_events, get_client):
125+
def test_span_origin(sentry_init, app, capture_items, get_client):
125126
sentry_init(
126127
integrations=[TrytondWSGIIntegration()],
127128
traces_sample_rate=1.0,
129+
trace_lifecycle="stream",
128130
)
129-
events = capture_events()
131+
items = capture_items()
130132

131133
@app.route("/something")
132134
def _(request):
@@ -135,6 +137,9 @@ def _(request):
135137
client = get_client()
136138
client.get("/something")
137139

138-
(event,) = events
140+
sentry_sdk.flush()
139141

140-
assert event["contexts"]["trace"]["origin"] == "auto.http.trytond_wsgi"
142+
(item,) = items
143+
span = item.payload
144+
145+
assert span["attributes"]["sentry.origin"] == "auto.http.trytond_wsgi"

0 commit comments

Comments
 (0)