From 4332feb1f0d1f7eb688199adcdafc5502a00b4ce Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Thu, 17 Oct 2024 09:27:38 +0200 Subject: [PATCH 1/3] test From 8845c72023fb9cc06e66e3902d288d298c489e04 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Thu, 17 Oct 2024 09:38:28 +0200 Subject: [PATCH 2/3] Skip brotli on 3.6 --- sentry_sdk/_compat.py | 1 + tests/test_transport.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sentry_sdk/_compat.py b/sentry_sdk/_compat.py index 3df12d5534..a811cf2120 100644 --- a/sentry_sdk/_compat.py +++ b/sentry_sdk/_compat.py @@ -10,6 +10,7 @@ PY37 = sys.version_info[0] == 3 and sys.version_info[1] >= 7 +PY38 = sys.version_info[0] == 3 and sys.version_info[1] >= 8 PY310 = sys.version_info[0] == 3 and sys.version_info[1] >= 10 PY311 = sys.version_info[0] == 3 and sys.version_info[1] >= 11 diff --git a/tests/test_transport.py b/tests/test_transport.py index 1c7bc8aac2..66a508e478 100644 --- a/tests/test_transport.py +++ b/tests/test_transport.py @@ -23,6 +23,7 @@ get_isolation_scope, Hub, ) +from sentry_sdk._compat import PY37, PY38 from sentry_sdk.envelope import Envelope, Item, parse_json from sentry_sdk.transport import ( KEEP_ALIVE_SOCKET_OPTIONS, @@ -123,10 +124,11 @@ def mock_transaction_envelope(span_count): @pytest.mark.parametrize("client_flush_method", ["close", "flush"]) @pytest.mark.parametrize("use_pickle", (True, False)) @pytest.mark.parametrize("compression_level", (0, 9, None)) -@pytest.mark.parametrize("compression_algo", ("gzip", "br", "", None)) @pytest.mark.parametrize( - "http2", [True, False] if sys.version_info >= (3, 8) else [False] + "compression_algo", + ("gzip", "br", "", None) if PY37 else ("gzip", "", None), ) +@pytest.mark.parametrize("http2", [True, False] if PY38 else [False]) def test_transport_works( capturing_server, request, From 76324485f868e18d0efa97de8cef98ddf4c2073c Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Thu, 17 Oct 2024 09:45:22 +0200 Subject: [PATCH 3/3] only in gevent is this a problem --- tests/test_transport.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_transport.py b/tests/test_transport.py index 66a508e478..2e4b36afd4 100644 --- a/tests/test_transport.py +++ b/tests/test_transport.py @@ -14,6 +14,11 @@ from pytest_localserver.http import WSGIServer from werkzeug.wrappers import Request, Response +try: + import gevent +except ImportError: + gevent = None + import sentry_sdk from sentry_sdk import ( Client, @@ -126,7 +131,11 @@ def mock_transaction_envelope(span_count): @pytest.mark.parametrize("compression_level", (0, 9, None)) @pytest.mark.parametrize( "compression_algo", - ("gzip", "br", "", None) if PY37 else ("gzip", "", None), + ( + ("gzip", "br", "", None) + if PY37 or gevent is None + else ("gzip", "", None) + ), ) @pytest.mark.parametrize("http2", [True, False] if PY38 else [False]) def test_transport_works(