Skip to content

Commit 7b9ea6e

Browse files
committed
fix: use openfeature error in tests
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
1 parent fb8f888 commit 7b9ea6e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

hooks/openfeature-hooks-opentelemetry/tests/test_metric.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from openfeature.contrib.hook.opentelemetry import MetricsHook
77
from openfeature.evaluation_context import EvaluationContext
8+
from openfeature.exception import FlagNotFoundError
89
from openfeature.flag_evaluation import Reason
910
from openfeature.hook import FlagEvaluationDetails, FlagType, HookContext
1011
from openfeature.provider.metadata import Metadata
@@ -170,13 +171,13 @@ def test_metric_error(mock_get_meter):
170171
evaluation_context=EvaluationContext(),
171172
provider_metadata=Metadata(name="test-provider"),
172173
)
173-
hook.error(hook_context, Exception("test error"), hints={})
174+
hook.error(hook_context, FlagNotFoundError("Flag not found: flag_key"), hints={})
174175
mock_counters["feature_flag.evaluation.error_total"].add.assert_called_once_with(
175176
1,
176177
{
177178
"feature_flag.key": "flag_key",
178179
"feature_flag.provider.name": "test-provider",
179-
"exception": "test error",
180+
"exception": "flag not found: flag_key",
180181
},
181182
)
182183
mock_counters["feature_flag.evaluation.success_total"].add.assert_not_called()

0 commit comments

Comments
 (0)