Skip to content

Commit c167118

Browse files
.
1 parent 2707b43 commit c167118

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ def append(envelope):
466466

467467
def flush(timeout=None, callback=None):
468468
real_flush(timeout=timeout, callback=callback)
469-
items_w.write(json.dumps(telemetry).encode("utf-8"))
470-
items_w.write(b"\n")
469+
items_w.write(json.dumps(telemetry).encode("utf-8") + b"\n")
470+
items_w.write(b"flush\n")
471471

472472
monkeypatch.setattr(test_client.transport, "capture_envelope", append)
473473
monkeypatch.setattr(test_client, "flush", flush)

tests/integrations/rq/test_rq.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import sentry_sdk
88
from sentry_sdk import start_transaction
9+
from sentry_sdk.consts import SPANDATA
910
from sentry_sdk.integrations.rq import RqIntegration
1011
from sentry_sdk.utils import SENSITIVE_DATA_SUBSTITUTE, parse_version
1112

@@ -197,6 +198,10 @@ def test_transaction_with_error(
197198
spans[44]["attributes"]["sentry.origin"]
198199
== error_event["contexts"]["trace"]["origin"]
199200
)
201+
assert (
202+
spans[44]["attributes"][SPANDATA.CODE_FUNCTION_NAME]
203+
== "tests.integrations.rq.test_rq.chew_up_shoes"
204+
)
200205
else:
201206
events = capture_events()
202207

@@ -360,7 +365,6 @@ def test_tracing_disabled(
360365
events = capture_events()
361366

362367
scope = sentry_sdk.get_isolation_scope()
363-
364368
queue.enqueue(crashing_job, foo=None)
365369
worker.work(burst=True)
366370

0 commit comments

Comments
 (0)