From f1f04b5777f15d021cc3452a106799b619a34a6d Mon Sep 17 00:00:00 2001 From: Ziming Date: Thu, 12 Nov 2026 12:38:05 -0500 Subject: [PATCH] Give the SS state test backend's stand-in system the situation hook policyengine-core PR 600 makes SimulationBuilder.build_from_entities call TaxBenefitSystem.preprocess_situation before building a situation. The Social Security state-machine backend copies that method into a stand-in system without the hook, so a Core release with it would fail the test. Add a no-op hook; today's Core never calls it. Co-Authored-By: Claude Opus 5.5 --- changelog.d/ss-backend-preprocess-situation-hook.fixed.md | 1 + .../tests/core/_social_security_state_backend.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 changelog.d/ss-backend-preprocess-situation-hook.fixed.md diff --git a/changelog.d/ss-backend-preprocess-situation-hook.fixed.md b/changelog.d/ss-backend-preprocess-situation-hook.fixed.md new file mode 100644 index 00000000000..4f65afe29fa --- /dev/null +++ b/changelog.d/ss-backend-preprocess-situation-hook.fixed.md @@ -0,0 +1 @@ +Give the Social Security state test backend's stand-in system the situation preprocessing hook that policyengine-core's builder calls. diff --git a/policyengine_us/tests/core/_social_security_state_backend.py b/policyengine_us/tests/core/_social_security_state_backend.py index 7b11f34d019..5a90ed0d99d 100644 --- a/policyengine_us/tests/core/_social_security_state_backend.py +++ b/policyengine_us/tests/core/_social_security_state_backend.py @@ -266,6 +266,12 @@ class System: data_modified = False auto_carry_over_input_variables = True + def preprocess_situation(self, situation, default_period=None): + # Core's build_from_entities calls this country hook before + # building a situation (policyengine-core PR 600); the + # fixture's one-person situation needs no groups filled in. + return situation + def __init__(self): self.cache_blacklist = list(cache_blacklist) self.variables = {