Skip to content

Commit b990610

Browse files
BYKclaude
andcommitted
fix: Skip loop close test when async transport deps missing
test_loop_close_flushes_async_transport needs ASYNC_TRANSPORT_ENABLED to be True. In gevent env (no httpcore[asyncio]), the _flush function correctly skips async transport handling, so close_async is never called. Skip the test in that case. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1ac4196 commit b990610

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/integrations/asyncio/test_asyncio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,10 @@ def test_loop_close_patching(sentry_init):
645645

646646
@minimum_python_38
647647
def test_loop_close_flushes_async_transport(sentry_init):
648-
from sentry_sdk.transport import AsyncHttpTransport
648+
from sentry_sdk.transport import ASYNC_TRANSPORT_ENABLED, AsyncHttpTransport
649+
650+
if not ASYNC_TRANSPORT_ENABLED:
651+
pytest.skip("httpcore[asyncio] not installed")
649652

650653
sentry_init(integrations=[AsyncioIntegration()])
651654

0 commit comments

Comments
 (0)