Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions tests/integrations/trytond_wsgi/test_trytond.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand All @@ -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"
Loading