Skip to content

Commit acc7126

Browse files
committed
span status test
1 parent 5175324 commit acc7126

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/tracing/test_span_streaming.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,23 @@ def test_set_span_status_on_error(sentry_init, capture_envelopes):
941941
assert span["status"] == "error"
942942

943943

944+
def test_set_span_status_on_ignored_span(sentry_init, capture_envelopes):
945+
sentry_init(
946+
traces_sample_rate=1.0,
947+
_experiments={"trace_lifecycle": "stream", "ignore_spans": ["ignored"]},
948+
)
949+
950+
events = capture_envelopes()
951+
952+
with sentry_sdk.traces.start_span(name="ignored") as span:
953+
span.status = "error"
954+
955+
sentry_sdk.get_client().flush()
956+
spans = envelopes_to_spans(events)
957+
958+
assert len(spans) == 0
959+
960+
944961
@pytest.mark.parametrize(
945962
("ignore_spans", "name", "attributes", "ignored"),
946963
[

0 commit comments

Comments
 (0)