Skip to content

Commit 0bf2a2b

Browse files
committed
merge master
1 parent 386d4ef commit 0bf2a2b

File tree

1 file changed

+11
-33
lines changed

1 file changed

+11
-33
lines changed

tests/integrations/httpx/test_httpx.py

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
from tests.conftest import ApproxDict
1212

1313

14-
timeout = httpx.Timeout(read=None, write=None, connect=None, pool=None)
15-
16-
1714
@pytest.mark.parametrize(
1815
"httpx_client",
1916
(httpx.Client(), httpx.AsyncClient()),
@@ -34,13 +31,10 @@ def before_breadcrumb(crumb, hint):
3431

3532
if asyncio.iscoroutinefunction(httpx_client.get):
3633
response = asyncio.get_event_loop().run_until_complete(
37-
httpx_client.get(
38-
url,
39-
timeout=timeout,
40-
)
34+
httpx_client.get(url)
4135
)
4236
else:
43-
response = httpx_client.get(url, timeout=timeout)
37+
response = httpx_client.get(url)
4438

4539
assert response.status_code == 200
4640
capture_message("Testing!")
@@ -84,13 +78,10 @@ def test_outgoing_trace_headers(sentry_init, httpx_client, httpx_mock):
8478
) as transaction:
8579
if asyncio.iscoroutinefunction(httpx_client.get):
8680
response = asyncio.get_event_loop().run_until_complete(
87-
httpx_client.get(
88-
url,
89-
timeout=timeout,
90-
)
81+
httpx_client.get(url)
9182
)
9283
else:
93-
response = httpx_client.get(url, timeout=timeout)
84+
response = httpx_client.get(url)
9485

9586
request_span = transaction._span_recorder.spans[-1]
9687
assert response.request.headers[
@@ -131,13 +122,10 @@ def test_outgoing_trace_headers_append_to_baggage(
131122
httpx_client.get(
132123
url,
133124
headers={"baGGage": "custom=data"},
134-
timeout=timeout,
135125
)
136126
)
137127
else:
138-
response = httpx_client.get(
139-
url, headers={"baGGage": "custom=data"}, timeout=timeout
140-
)
128+
response = httpx_client.get(url, headers={"baGGage": "custom=data"})
141129

142130
request_span = transaction._span_recorder.spans[-1]
143131
assert response.request.headers[
@@ -285,14 +273,9 @@ def test_option_trace_propagation_targets(
285273

286274
with sentry_sdk.start_transaction(): # Must be in a transaction to propagate headers
287275
if asyncio.iscoroutinefunction(httpx_client.get):
288-
asyncio.get_event_loop().run_until_complete(
289-
httpx_client.get(
290-
url,
291-
timeout=timeout,
292-
)
293-
)
276+
asyncio.get_event_loop().run_until_complete(httpx_client.get(url))
294277
else:
295-
httpx_client.get(url, timeout=timeout)
278+
httpx_client.get(url)
296279

297280
request_headers = httpx_mock.get_request().headers
298281

@@ -312,7 +295,7 @@ def test_do_not_propagate_outside_transaction(sentry_init, httpx_mock):
312295
)
313296

314297
httpx_client = httpx.Client()
315-
httpx_client.get("http://example.com/", timeout=timeout)
298+
httpx_client.get("http://example.com/")
316299

317300
request_headers = httpx_mock.get_request().headers
318301
assert "sentry-trace" not in request_headers
@@ -332,7 +315,7 @@ def test_omit_url_data_if_parsing_fails(sentry_init, capture_events, httpx_mock)
332315
"sentry_sdk.integrations.httpx.parse_url",
333316
side_effect=ValueError,
334317
):
335-
response = httpx_client.get(url, timeout=timeout)
318+
response = httpx_client.get(url)
336319

337320
assert response.status_code == 200
338321
capture_message("Testing!")
@@ -370,14 +353,9 @@ def test_span_origin(sentry_init, capture_events, httpx_client, httpx_mock):
370353

371354
with start_transaction(name="test_transaction"):
372355
if asyncio.iscoroutinefunction(httpx_client.get):
373-
asyncio.get_event_loop().run_until_complete(
374-
httpx_client.get(
375-
url,
376-
timeout=timeout,
377-
)
378-
)
356+
asyncio.get_event_loop().run_until_complete(httpx_client.get(url))
379357
else:
380-
httpx_client.get(url, timeout=timeout)
358+
httpx_client.get(url)
381359

382360
(event,) = events
383361

0 commit comments

Comments
 (0)