Skip to content

Commit 07b512e

Browse files
committed
fixup! Add evaluation details to finally hook stage #403
Signed-off-by: christian.lutnik <[email protected]>
1 parent 6f71842 commit 07b512e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

openfeature/client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,15 @@ def evaluate_flag_details( # noqa: PLR0915
393393
return flag_evaluation
394394

395395
finally:
396+
if flag_evaluation is None: # should never happen, but keeps the linter happy
397+
flag_evaluation = FlagEvaluationDetails(
398+
flag_key=flag_key,
399+
value=default_value,
400+
reason=Reason.ERROR,
401+
error_code=ErrorCode.GENERAL,
402+
error_message="Unknown error",
403+
)
404+
396405
after_all_hooks(
397406
flag_type,
398407
hook_context,

tests/features/steps/hooks_steps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def convert_value_from_flag_type(value, flag_type):
5555
return float(value)
5656
return value
5757

58+
5859
@then('"{hook_names}" hooks should have evaluation details')
5960
def step_impl_should_have_eval_details(context, hook_names):
6061
for hook_name in hook_names.split(", "):

0 commit comments

Comments
 (0)