Skip to content

Commit 9592fa6

Browse files
Test: Add comprehensive holdout test scenarios aligned with Swift SDK
- Add decideAll tests with various holdout configurations (global, included, excluded, multiple) - Add holdout status tests (Draft, Concluded, Archived should not apply) - Add impression event metadata tests - Add test for holdout impressions with sendFlagDecisions=false - Add audience targeting tests for holdouts - Add enabledFlagsOnly option test - Fix existing tests to work with Holdout entity objects (not dicts) - Fix impression event logic to always send holdout impressions (matching Swift SDK) All 35 holdout tests now passing, matching Swift SDK test coverage.
1 parent beaa8b3 commit 9592fa6

File tree

2 files changed

+567
-17
lines changed

2 files changed

+567
-17
lines changed

optimizely/optimizely.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,9 +1260,10 @@ def _create_optimizely_decision(
12601260
feature_flag = project_config.feature_key_map.get(flag_key)
12611261

12621262
# Send impression event if Decision came from a feature
1263-
# test and decide options doesn't include disableDecisionEvent
1263+
# test, holdout, or send_flag_decisions is enabled
1264+
# Holdouts always send impressions regardless of sendFlagDecisions setting
12641265
if OptimizelyDecideOption.DISABLE_DECISION_EVENT not in decide_options:
1265-
if decision_source == DecisionSources.FEATURE_TEST or project_config.send_flag_decisions:
1266+
if decision_source == DecisionSources.FEATURE_TEST or decision_source == DecisionSources.HOLDOUT or project_config.send_flag_decisions:
12661267
self._send_impression_event(project_config,
12671268
flag_decision.experiment,
12681269
flag_decision.variation,

0 commit comments

Comments
 (0)