Skip to content

Commit 0296b80

Browse files
sentrivanaclaude
andcommitted
refactor: Unpack spans directly instead of filtering
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c7e452c commit 0296b80

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

tests/integrations/stdlib/test_httplib.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,14 +1219,9 @@ def test_chunked_response_span_covers_body_read(
12191219
response.read()
12201220

12211221
sentry_sdk.flush()
1222-
spans = [item.payload for item in items if item.type == "span"]
1223-
(span,) = (
1224-
span
1225-
for span in spans
1226-
if span["attributes"].get("sentry.origin") == "auto.http.stdlib.httplib"
1227-
)
1222+
http_span, parent_span = [item.payload for item in items]
12281223

1229-
duration = span["end_timestamp"] - span["start_timestamp"]
1224+
duration = http_span["end_timestamp"] - http_span["start_timestamp"]
12301225
assert duration >= min_expected_duration
12311226
else:
12321227
events = capture_events()

0 commit comments

Comments
 (0)