10
10
from fastapi import FastAPI
11
11
from fastapi .testclient import TestClient
12
12
from flask import Flask
13
- from strawberry .extensions .tracing import (
14
- SentryTracingExtension ,
15
- SentryTracingExtensionSync ,
16
- )
17
13
from strawberry .fastapi import GraphQLRouter
18
14
from strawberry .flask .views import GraphQLView
19
15
28
24
)
29
25
from tests .conftest import ApproxDict
30
26
27
+ try :
28
+ from strawberry .extensions .tracing import (
29
+ SentryTracingExtension ,
30
+ SentryTracingExtensionSync ,
31
+ )
32
+ except ImportError :
33
+ SentryTracingExtension = None
34
+ SentryTracingExtensionSync = None
35
+
31
36
parameterize_strawberry_test = pytest .mark .parametrize (
32
37
"client_factory,async_execution,framework_integrations" ,
33
38
(
@@ -143,6 +148,10 @@ def test_infer_execution_type_from_installed_packages_sync(sentry_init):
143
148
assert SentrySyncExtension in schema .extensions
144
149
145
150
151
+ @pytest .mark .skipif (
152
+ SentryTracingExtension is None ,
153
+ reason = "SentryTracingExtension no longer available in this Strawberry version" ,
154
+ )
146
155
def test_replace_existing_sentry_async_extension (sentry_init ):
147
156
sentry_init (integrations = [StrawberryIntegration ()])
148
157
@@ -152,6 +161,10 @@ def test_replace_existing_sentry_async_extension(sentry_init):
152
161
assert SentryAsyncExtension in schema .extensions
153
162
154
163
164
+ @pytest .mark .skipif (
165
+ SentryTracingExtensionSync is None ,
166
+ reason = "SentryTracingExtensionSync no longer available in this Strawberry version" ,
167
+ )
155
168
def test_replace_existing_sentry_sync_extension (sentry_init ):
156
169
sentry_init (integrations = [StrawberryIntegration ()])
157
170
0 commit comments