Repository navigation
Fix the Social Security state-machine test helper for Core 3.39.0 - #11657
Merged
Merged
Conversation
Core 3.39.0 adds read-only simulations. The Core bodies this helper selects now read Simulation.read_only, call refuse_on_read_only and make_non_writable, and route Holder.delete_arrays through a new _delete_arrays. Give the fixture each of them when the installed Core has it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
3 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11658
Fixes the
test_social_security_input_state_machine.pyfailure that started on every PR after policyengine-core 3.39.0 was released.What and why
CI installs the newest compatible Core on each run. Core 3.39.0, released on December 1, 2026 at 3:10pm EST, adds read-only simulations. The test's helper,
_social_security_state_backend.py, runs selected Core method bodies inside a small fixture. Those bodies now use three things the fixture lacked:_cache_result,_calculate,get_branch,_bind_to_tax_benefit_systemand_invalidate_all_cachesreadself.read_onlyread_only = Falseon the fixture'sSimulation. The fixture never makes a simulation read-onlyrefuse_on_read_only, and calculation routes callmake_non_writablefor a read-only simulationHolder.delete_arrayscalls a newHolder._delete_arraysThe first failure was
AttributeError: 'DelegatingSimulation' object has no attribute 'read_only'in "Full Suite - Rest (Python shard 1)" on #11235, whose shard started ten minutes after the release.Each addition depends on the installed Core, so the helper still works with the locked Core 3.37.2. No model code changes.
Test plan
policyengine_us/tests/core/test_social_security_input_state_machine.pypasses locally against Core 3.39.0 and against the locked Core 3.37.2. It failed against 3.39.0 before the change. No other test imports the helper.Reform,psutilandtools), on routes the test does not reach.make format:ruff format --checkandruff checkpass on the changed file.changelog.d/axiom: n/a: test helper only; no policy change
🤖 Generated with Claude Code