Skip to content

Commit 78b9857

Browse files
committed
test(transport): Add AsyncIO integration to async transport tests
GH-4601
1 parent 5699c67 commit 78b9857

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_transport.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
AsyncHttpTransport,
3434
)
3535
from sentry_sdk.integrations.logging import LoggingIntegration, ignore_logger
36+
from sentry_sdk.integrations.asyncio import AsyncioIntegration
3637

3738

3839
server = None
@@ -182,6 +183,7 @@ async def test_transport_works_async(
182183
client = make_client(
183184
debug=debug,
184185
_experiments=experiments,
186+
integrations=[AsyncioIntegration()],
185187
)
186188

187189
if use_pickle:
@@ -811,7 +813,7 @@ async def test_async_transport_background_thread_capture(
811813
"""Test capture_envelope from background threads uses run_coroutine_threadsafe"""
812814
caplog.set_level(logging.DEBUG)
813815
experiments = {"transport_async": True}
814-
client = make_client(_experiments=experiments)
816+
client = make_client(_experiments=experiments, integrations=[AsyncioIntegration()])
815817
assert isinstance(client.transport, AsyncHttpTransport)
816818
sentry_sdk.get_global_scope().set_client(client)
817819
captured_from_thread = []
@@ -842,7 +844,7 @@ async def test_async_transport_event_loop_closed_scenario(
842844
"""Test behavior when trying to capture after event loop context ends"""
843845
caplog.set_level(logging.DEBUG)
844846
experiments = {"transport_async": True}
845-
client = make_client(_experiments=experiments)
847+
client = make_client(_experiments=experiments, integrations=[AsyncioIntegration()])
846848
sentry_sdk.get_global_scope().set_client(client)
847849
original_loop = client.transport.loop
848850

@@ -868,7 +870,7 @@ async def test_async_transport_concurrent_requests(
868870
"""Test multiple simultaneous envelope submissions"""
869871
caplog.set_level(logging.DEBUG)
870872
experiments = {"transport_async": True}
871-
client = make_client(_experiments=experiments)
873+
client = make_client(_experiments=experiments, integrations=[AsyncioIntegration()])
872874
assert isinstance(client.transport, AsyncHttpTransport)
873875
sentry_sdk.get_global_scope().set_client(client)
874876

@@ -892,7 +894,7 @@ async def test_async_transport_rate_limiting_with_concurrency(
892894
):
893895
"""Test async transport rate limiting with concurrent requests"""
894896
experiments = {"transport_async": True}
895-
client = make_client(_experiments=experiments)
897+
client = make_client(_experiments=experiments, integrations=[AsyncioIntegration()])
896898

897899
assert isinstance(client.transport, AsyncHttpTransport)
898900
sentry_sdk.get_global_scope().set_client(client)
@@ -930,6 +932,7 @@ async def test_async_two_way_ssl_authentication():
930932
cert_file=cert_file,
931933
key_file=key_file,
932934
_experiments={"transport_async": True},
935+
integrations=[AsyncioIntegration()],
933936
)
934937
assert isinstance(client.transport, AsyncHttpTransport)
935938

0 commit comments

Comments
 (0)