Add unit tests for CPS marriage tax reforms (#737)#1642
Open
vahid-ahmadi wants to merge 1 commit intomainfrom
Open
Add unit tests for CPS marriage tax reforms (#737)#1642vahid-ahmadi wants to merge 1 commit intomainfrom
vahid-ahmadi wants to merge 1 commit intomainfrom
Conversation
Expose module-level Reform instances (`expanded_ma_reform`, `marriage_neutral_it_reform`) so YAML tests can reference them by dotted import path, matching the existing pattern used by `scottish_child_payment_reform`. Both are built with no child-age or education filters, so they apply to every married couple in tests. Add three initial test cases covering the reform mechanics: - Expanded MA: a single higher-rate earner has no Marriage Allowance even with the reform active (no spouse to transfer from). - Expanded MA: a married higher-rate earner with a low-earning spouse receives Marriage Allowance under the reform (normally ineligible under ITA 2007 s. 55B because they're over the basic rate). With take-up forced to 1.0, the expected transfer is £1,260 — low earner's unused PA capped at PA × ma_rate, rounded up to the £10 increment. - Marriage-neutral IT: a single person's adjusted net income is unchanged because `has_spouse` is False and the optimal-split branch collapses to the original income. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
expanded_ma_reform,marriage_neutral_it_reform) inpolicyengine_uk/reforms/cps/marriage_tax_reforms.pyso YAML tests can reference them by dotted import path — matching the pattern used byscottish_child_payment_reform. Both are built with no child-age or education filters, so they apply to every married couple in tests.policyengine_uk/tests/policy/reforms/cps/marriage_tax_reforms.yaml:adjusted_net_incomeunchanged (has_spouse False → optimal-split branch collapses to original income).Closes #737.
Notes
Test plan
policyengine-core testrun.🤖 Generated with Claude Code