Skip to content

Commit addcea6

Browse files
committed
test(o11y): eliminate 'traces' references and improve test readability
1 parent 6e66cb0 commit addcea6

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

packages/google-api-core/tests/unit/observability/test_options.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,23 @@ def clean_overrides():
3232
@pytest.mark.parametrize(
3333
"value,expected",
3434
[
35+
# Truthy values
3536
("y", True),
3637
("yes", True),
3738
("t", True),
3839
("true", True),
3940
("on", True),
4041
("1", True),
42+
(" True ", True),
43+
# Falsy values
4144
("n", False),
4245
("no", False),
4346
("f", False),
4447
("false", False),
4548
("off", False),
4649
("0", False),
47-
(" True ", True),
4850
(" FALSE ", False),
51+
# Empty string
4952
("", None),
5053
],
5154
)
@@ -132,11 +135,12 @@ def test_get_env_bool_with_dev_fallback_other_prefix(monkeypatch):
132135
False,
133136
True,
134137
),
135-
# Programmatic boolean flags are NOT supported (should default/fallback)
138+
# Programmatic boolean flags are NOT supported in client_options
139+
# (should default/fallback to False)
136140
(
137141
"tracing",
138142
{"GOOGLE_CLOUD_PYTHON_TRACING_ENABLED": False},
139-
{"enable_traces": True},
143+
{"enable_metrics": True},
140144
False,
141145
False,
142146
),
@@ -164,4 +168,4 @@ def test_is_signal_enabled(
164168

165169
def test_is_signal_enabled_invalid_signal():
166170
with pytest.raises(ValueError, match="Only 'tracing' is supported"):
167-
options.is_signal_enabled("traces")
171+
options.is_signal_enabled("metrics")

0 commit comments

Comments
 (0)