Skip to content

Commit 55c720f

Browse files
committed
tests and some docs
1 parent d295505 commit 55c720f

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

sentry_sdk/consts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,8 @@ def __init__(
10241024
This is relative to the tracing sample rate - e.g. `0.5` means 50% of sampled transactions will be
10251025
profiled.
10261026
1027+
:param http2: Defaults to `True`, enables HTTP/2 support for the SDK.
1028+
10271029
:param profiles_sampler:
10281030
10291031
:param profiler_mode:

tests/integrations/excepthook/test_excepthook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from textwrap import dedent
66

77

8-
TEST_PARAMETERS = [("", "HttpTransport")]
8+
TEST_PARAMETERS = [("http2=False", "HttpTransport")]
99

1010
if sys.version_info >= (3, 8):
11-
TEST_PARAMETERS.append(('_experiments={"transport_http2": True}', "Http2Transport"))
11+
TEST_PARAMETERS.append(("", "Http2Transport"))
1212

1313

1414
@pytest.mark.parametrize("options, transport", TEST_PARAMETERS)

tests/test_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ def test_proxy(monkeypatch, testcase, http2):
258258

259259
kwargs = {}
260260

261-
if http2:
262-
kwargs["_experiments"] = {"transport_http2": True}
261+
if not http2:
262+
kwargs["http2"] = False
263263

264264
if testcase["arg_http_proxy"] is not None:
265265
kwargs["http_proxy"] = testcase["arg_http_proxy"]
@@ -362,8 +362,8 @@ def test_proxy(monkeypatch, testcase, http2):
362362
def test_socks_proxy(testcase, http2):
363363
kwargs = {}
364364

365-
if http2:
366-
kwargs["_experiments"] = {"transport_http2": True}
365+
if not http2:
366+
kwargs["http2"] = False
367367

368368
if testcase["arg_http_proxy"] is not None:
369369
kwargs["http_proxy"] = testcase["arg_http_proxy"]
@@ -565,10 +565,10 @@ def test_capture_event_works(sentry_init):
565565
)
566566
def test_atexit(tmpdir, monkeypatch, num_messages, http2):
567567
if http2:
568-
options = '_experiments={"transport_http2": True}'
568+
options = "http2=True"
569569
transport = "Http2Transport"
570570
else:
571-
options = ""
571+
options = "http2=False"
572572
transport = "HttpTransport"
573573

574574
app = tmpdir.join("app.py")

tests/test_transport.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ def test_transport_works(
157157
if compression_algo is not None:
158158
experiments["transport_compression_algo"] = compression_algo
159159

160-
if http2:
161-
experiments["transport_http2"] = True
160+
if not http2:
161+
experiments["http2"] = False
162162

163163
client = make_client(
164164
debug=debug,
@@ -223,17 +223,13 @@ def test_transport_num_pools(make_client, num_pools, expected_num_pools):
223223
"http2", [True, False] if sys.version_info >= (3, 8) else [False]
224224
)
225225
def test_two_way_ssl_authentication(make_client, http2):
226-
_experiments = {}
227-
if http2:
228-
_experiments["transport_http2"] = True
229-
230226
current_dir = os.path.dirname(__file__)
231227
cert_file = f"{current_dir}/test.pem"
232228
key_file = f"{current_dir}/test.key"
233229
client = make_client(
234230
cert_file=cert_file,
235231
key_file=key_file,
236-
_experiments=_experiments,
232+
http2=http2,
237233
)
238234
options = client.transport._get_pool_options()
239235

@@ -280,7 +276,7 @@ def test_default_timeout(make_client):
280276

281277
@pytest.mark.skipif(not PY38, reason="HTTP2 libraries are only available in py3.8+")
282278
def test_default_timeout_http2(make_client):
283-
client = make_client(_experiments={"transport_http2": True})
279+
client = make_client()
284280

285281
with mock.patch(
286282
"sentry_sdk.transport.httpcore.ConnectionPool.request",
@@ -303,15 +299,15 @@ def test_default_timeout_http2(make_client):
303299

304300
@pytest.mark.skipif(not PY38, reason="HTTP2 libraries are only available in py3.8+")
305301
def test_http2_with_https_dsn(make_client):
306-
client = make_client(_experiments={"transport_http2": True})
302+
client = make_client()
307303
client.transport.parsed_dsn.scheme = "https"
308304
options = client.transport._get_pool_options()
309305
assert options["http2"] is True
310306

311307

312308
@pytest.mark.skipif(not PY38, reason="HTTP2 libraries are only available in py3.8+")
313309
def test_no_http2_with_http_dsn(make_client):
314-
client = make_client(_experiments={"transport_http2": True})
310+
client = make_client()
315311
client.transport.parsed_dsn.scheme = "http"
316312
options = client.transport._get_pool_options()
317313
assert options["http2"] is False

0 commit comments

Comments
 (0)