1010from sentry_sdk .integrations .openfeature import OpenFeatureIntegration
1111
1212
13- def test_openfeature_integration (sentry_init , capture_events , uninstall_integration ):
13+ @pytest .mark .parametrize (
14+ "use_global_client" ,
15+ (False , True ),
16+ )
17+ def test_openfeature_integration (
18+ sentry_init , use_global_client , capture_events , uninstall_integration
19+ ):
1420 flags = {
1521 "hello" : InMemoryFlag ("on" , {"on" : True , "off" : False }),
1622 "world" : InMemoryFlag ("off" , {"on" : True , "off" : False }),
@@ -19,7 +25,10 @@ def test_openfeature_integration(sentry_init, capture_events, uninstall_integrat
1925 client = api .get_client ()
2026
2127 uninstall_integration (OpenFeatureIntegration .identifier )
22- sentry_init (integrations = [OpenFeatureIntegration (client )])
28+ if use_global_client :
29+ sentry_init (integrations = [OpenFeatureIntegration ()])
30+ else :
31+ sentry_init (integrations = [OpenFeatureIntegration (client = client )])
2332
2433 client .get_boolean_value ("hello" , default_value = False )
2534 client .get_boolean_value ("world" , default_value = False )
@@ -49,7 +58,7 @@ def test_openfeature_integration_threaded(
4958 client = api .get_client ()
5059
5160 uninstall_integration (OpenFeatureIntegration .identifier )
52- sentry_init (integrations = [OpenFeatureIntegration (client )])
61+ sentry_init (integrations = [OpenFeatureIntegration (client = client )])
5362 events = capture_events ()
5463
5564 # Capture an eval before we split isolation scopes.
@@ -109,7 +118,7 @@ def test_openfeature_integration_asyncio(
109118 client = api .get_client ()
110119
111120 uninstall_integration (OpenFeatureIntegration .identifier )
112- sentry_init (integrations = [OpenFeatureIntegration (client )])
121+ sentry_init (integrations = [OpenFeatureIntegration (client = client )])
113122 events = capture_events ()
114123
115124 # Capture an eval before we split isolation scopes.
0 commit comments