Skip to content

Commit 3bda6aa

Browse files
Copilotkhvn26
andcommitted
fix: ensure consistent API usage for engine.get_evaluation_result
Co-authored-by: khvn26 <[email protected]>
1 parent 8f10c42 commit 3bda6aa

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

flagsmith/flagsmith.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,9 @@ def _get_environment_flags_from_document(self) -> Flags:
343343
},
344344
)
345345

346-
evaluation_result = engine.get_evaluation_result(context_without_segments)
346+
evaluation_result = engine.get_evaluation_result(
347+
context=context_without_segments,
348+
)
347349

348350
return Flags.from_evaluation_result(
349351
evaluation_result=evaluation_result,

tests/test_flagsmith.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_get_environment_flags_omits_segments_from_evaluation_context(
124124
# Then
125125
mock_engine.get_evaluation_result.assert_called_once()
126126
call_args = mock_engine.get_evaluation_result.call_args
127-
context = call_args[0][0] # First positional argument
127+
context = call_args[1]["context"] # Keyword argument 'context'
128128
# Segments should not be present in the context passed to the engine
129129
assert "segments" not in context
130130

0 commit comments

Comments
 (0)