Skip to content

Commit e54e888

Browse files
committed
....
1 parent d9eead4 commit e54e888

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tests/integrations/httpx/test_httpx.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from tests.conftest import ApproxDict
1313

1414

15-
timeout = httpx.Timeout(5.0, read=None, connect=None)
15+
timeout = httpx.Timeout(10)
1616

1717

1818
@pytest.mark.parametrize(
@@ -40,7 +40,7 @@ def before_breadcrumb(crumb, hint):
4040
)
4141
)
4242
else:
43-
response = httpx_client.get(url)
43+
response = httpx_client.get(url, timeout=timeout)
4444

4545
assert response.status_code == 200
4646
capture_message("Testing!")
@@ -86,7 +86,7 @@ def test_outgoing_trace_headers(sentry_init, httpx_client):
8686
)
8787
)
8888
else:
89-
response = httpx_client.get(url)
89+
response = httpx_client.get(url, timeout=timeout)
9090

9191
request_span = transaction._span_recorder.spans[-1]
9292
assert response.request.headers[
@@ -126,7 +126,9 @@ def test_outgoing_trace_headers_append_to_baggage(sentry_init, httpx_client):
126126
)
127127
)
128128
else:
129-
response = httpx_client.get(url, headers={"baGGage": "custom=data"})
129+
response = httpx_client.get(
130+
url, headers={"baGGage": "custom=data"}, timeout=timeout
131+
)
130132

131133
request_span = transaction._span_recorder.spans[-1]
132134
assert response.request.headers[
@@ -281,7 +283,7 @@ def test_option_trace_propagation_targets(
281283
)
282284
)
283285
else:
284-
httpx_client.get(url)
286+
httpx_client.get(url, timeout=timeout)
285287

286288
request_headers = httpx_mock.get_request().headers
287289

@@ -301,7 +303,7 @@ def test_do_not_propagate_outside_transaction(sentry_init, httpx_mock):
301303
)
302304

303305
httpx_client = httpx.Client()
304-
httpx_client.get("http://example.com/")
306+
httpx_client.get("http://example.com/", timeout=timeout)
305307

306308
request_headers = httpx_mock.get_request().headers
307309
assert "sentry-trace" not in request_headers
@@ -320,7 +322,7 @@ def test_omit_url_data_if_parsing_fails(sentry_init, capture_events):
320322
"sentry_sdk.integrations.httpx.parse_url",
321323
side_effect=ValueError,
322324
):
323-
response = httpx_client.get(url)
325+
response = httpx_client.get(url, timeout=timeout)
324326

325327
assert response.status_code == 200
326328
capture_message("Testing!")
@@ -364,7 +366,7 @@ def test_span_origin(sentry_init, capture_events, httpx_client):
364366
)
365367
)
366368
else:
367-
httpx_client.get(url)
369+
httpx_client.get(url, timeout=timeout)
368370

369371
(event,) = events
370372

0 commit comments

Comments
 (0)