Skip to content

Commit cdaa63a

Browse files
committed
Update more tests
1 parent 665447a commit cdaa63a

2 files changed

Lines changed: 283 additions & 93 deletions

File tree

sentry_sdk/integrations/asyncio.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from sentry_sdk.consts import OP
66
from sentry_sdk.integrations import DidNotEnable, Integration
77
from sentry_sdk.integrations._wsgi_common import nullcontext
8+
from sentry_sdk.traces import StreamedSpan
9+
from sentry_sdk.tracing import Span
810
from sentry_sdk.tracing_utils import has_span_streaming_enabled
911
from sentry_sdk.transport import AsyncHttpTransport
1012
from sentry_sdk.utils import (
@@ -20,7 +22,7 @@
2022
except ImportError:
2123
raise DidNotEnable("asyncio not available")
2224

23-
from typing import TYPE_CHECKING
25+
from typing import TYPE_CHECKING, Optional, Union
2426

2527
if TYPE_CHECKING:
2628
from collections.abc import Coroutine
@@ -147,7 +149,7 @@ async def _task_with_sentry_span_creation() -> "Any":
147149
integration = client.get_integration(AsyncioIntegration)
148150
task_spans = integration.task_spans if integration else False
149151

150-
span_ctx = None
152+
span_ctx: "Optional[Union[StreamedSpan, Span]]" = None
151153
is_span_streaming_enabled = has_span_streaming_enabled(client.options)
152154

153155
with sentry_sdk.isolation_scope():

0 commit comments

Comments
 (0)