@@ -84,10 +84,10 @@ def test_resolve_feature_flags_ga_enabled_via_env(monkeypatch):
8484
8585
8686@pytest .mark .parametrize ("exp_env_state" , [None , "false" ], ids = ["missing" , "disabled" ])
87- def test_resolve_feature_flags_exp_blocked_with_provider_fails_fast (
87+ def test_resolve_feature_flags_exp_blocked_with_feature_key_fails_fast (
8888 monkeypatch , exp_env_state
8989):
90- """Verify that passing a provider to an experimental feature raises ValueError if the experimental environment variable is disabled or missing."""
90+ """Verify that passing a feature_key to an experimental feature raises FeatureGatingError if the experimental environment variable is disabled or missing."""
9191 # Setup: Experimental env var is set to exp_env_state (None means not set)
9292 if exp_env_state is not None :
9393 monkeypatch .setenv (
@@ -108,8 +108,8 @@ def test_resolve_feature_flags_exp_blocked_with_provider_fails_fast(
108108 )
109109
110110
111- def test_resolve_feature_flags_exp_enabled_with_provider (monkeypatch ):
112- """Verify that experimental feature is enabled if the experimental environment variable is enabled and a provider is provided."""
111+ def test_resolve_feature_flags_exp_enabled_with_feature_key (monkeypatch ):
112+ """Verify that experimental feature is enabled if the experimental environment variable is enabled and a feature_key is provided."""
113113 monkeypatch .setenv ("GOOGLE_SDK_EXPERIMENTAL_PYTHON_TRACING_ENABLED" , "true" )
114114 configuration = {"tracer_provider" : object ()}
115115
@@ -121,8 +121,8 @@ def test_resolve_feature_flags_exp_enabled_with_provider(monkeypatch):
121121 assert result is True
122122
123123
124- def test_resolve_feature_flags_exp_enabled_without_provider (monkeypatch ):
125- """Verify that experimental feature is enabled if the experimental environment variable is enabled and NO provider is provided."""
124+ def test_resolve_feature_flags_exp_enabled_without_feature_key (monkeypatch ):
125+ """Verify that experimental feature is enabled if the experimental environment variable is enabled and NO feature_key is provided."""
126126 monkeypatch .setenv ("GOOGLE_SDK_EXPERIMENTAL_PYTHON_TRACING_ENABLED" , "true" )
127127
128128 result = _feature_gating_helpers .resolve_feature_flags (
@@ -133,8 +133,8 @@ def test_resolve_feature_flags_exp_enabled_without_provider(monkeypatch):
133133 assert result is True
134134
135135
136- def test_resolve_feature_flags_exp_disabled_without_provider (monkeypatch ):
137- """Verify that experimental feature is disabled if the experimental environment variable is disabled and NO provider is provided."""
136+ def test_resolve_feature_flags_exp_disabled_without_feature_key (monkeypatch ):
137+ """Verify that experimental feature is disabled if the experimental environment variable is disabled and NO feature_key is provided."""
138138 monkeypatch .setenv ("GOOGLE_SDK_EXPERIMENTAL_PYTHON_TRACING_ENABLED" , "false" )
139139
140140 result = _feature_gating_helpers .resolve_feature_flags (
@@ -145,9 +145,9 @@ def test_resolve_feature_flags_exp_disabled_without_provider(monkeypatch):
145145 assert result is False
146146
147147
148- def test_resolve_feature_flags_ga_enabled_via_provider (monkeypatch ):
149- """Verify that a GA feature is enabled if a provider is provided, ignoring the environment variable."""
150- # Env var is False, but provider is present
148+ def test_resolve_feature_flags_ga_enabled_via_feature_key (monkeypatch ):
149+ """Verify that a GA feature is enabled if a feature_key is provided, ignoring the environment variable."""
150+ # Env var is False, but feature_key is present in configuration
151151 monkeypatch .setenv ("GOOGLE_SDK_PYTHON_TRACING_ENABLED" , "false" )
152152 configuration = {"tracer_provider" : object ()}
153153
@@ -163,7 +163,7 @@ def test_resolve_feature_flags_ga_enabled_via_provider(monkeypatch):
163163 "env_val" , [None , "false" ], ids = ["env_not_set" , "env_explicit_false" ]
164164)
165165def test_resolve_feature_flags_ga_fallback_to_false (monkeypatch , env_val ):
166- """Verify that a GA feature is disabled if neither a provider is provided nor the environment variable is enabled."""
166+ """Verify that a GA feature is disabled if neither a feature_key is provided nor the environment variable is enabled."""
167167 if env_val is not None :
168168 monkeypatch .setenv ("GOOGLE_SDK_PYTHON_TRACING_ENABLED" , env_val )
169169 else :
@@ -190,7 +190,7 @@ def __init__(self):
190190 ids = ["dict_without_key" , "object_without_key" ],
191191)
192192def test_resolve_feature_flags_options_without_key (configuration ):
193- """Verify behavior when configuration is present but missing the provider key."""
193+ """Verify behavior when configuration is present but missing the feature key."""
194194 # GA Path: should fall through to env var / fallback
195195 result = _feature_gating_helpers .resolve_feature_flags (
196196 env_var = "GOOGLE_SDK_PYTHON_TRACING_ENABLED" ,
@@ -201,7 +201,7 @@ def test_resolve_feature_flags_options_without_key(configuration):
201201
202202
203203def test_resolve_feature_flags_rejects_dunder_keys (monkeypatch ):
204- """Verify that dunder keys are rejected early in _has_provider ."""
204+ """Verify that dunder keys are rejected early in _has_feature_key ."""
205205 # We use a dunder key that exists on all objects (__class__)
206206 # If the guardrail is missing, getattr might return it and return True
207207 configuration = {"__class__" : "some_value" }
0 commit comments