Skip to content

Commit d62b438

Browse files
add another test
1 parent 1423433 commit d62b438

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/tracing/test_ignore_status_codes.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,19 @@ def test_malformed_argument_ignored(sentry_init, capture_events):
118118
span_or_tx.set_data("http.response.status_code", 404)
119119

120120
assert len(events) == 1
121+
122+
123+
def test_transaction_not_ignored_when_status_code_has_invalid_type(
124+
sentry_init, capture_events
125+
):
126+
sentry_init(
127+
traces_sample_rate=1.0,
128+
trace_ignore_status_codes=(404,),
129+
)
130+
events = capture_events()
131+
132+
with start_transaction(op="http", name="GET /"):
133+
span_or_tx = sentry_sdk.get_current_span()
134+
span_or_tx.set_data("http.response.status_code", "404")
135+
136+
assert len(events) == 1

0 commit comments

Comments
 (0)