Skip engine-backed head-to-head scorer tests without the us extra - #817
Open
MaxGhenis wants to merge 1 commit into
Open
Skip engine-backed head-to-head scorer tests without the us extra#817MaxGhenis wants to merge 1 commit into
MaxGhenis wants to merge 1 commit into
Conversation
The four tests that call load_artifact on real H5 fixtures reach release._load_frame, which imports policyengine_us.data at call time, so under a no-extras sync they failed instead of skipping. The registered requires_us marker lets the root collection hook skip them when the engine is absent, per the engine-gated test convention. Co-Authored-By: Claude Fable 5 <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.
What
Adds the registered
requires_usmarker to the four tests inpackages/microcosm-build/tests/test_us_release_head_to_head_scorer.pythat load real H5 fixtures throughmodule.load_artifact:test_incumbent_and_candidate_h5_loaders_preserve_scored_contracttest_historical_formula_owned_h5_scores_with_drop_receipttest_historical_formula_owned_h5_refuses_missing_leaftest_clean_historical_h5_scores_with_empty_drop_receiptWhy
Under a no-extras sync (
uv sync --all-packages, no--extra us) these tests run and fail instead of skipping.load_artifact→_load_h5→release._load_framedoesfrom policyengine_us.data import USSingleYearDatasetat call time (tools/build_us_fiscal_refresh_release.py:2607), which raisesModuleNotFoundErrorwhen the extra is absent. Their existingpytest.importorskip("tables")guard covers pytables only, not the engine.Per CLAUDE.md, engine-gated tests must skip via the registered
requires_us/requires_ukmarkers (the root conftest collection hook) or an existingimportorskipguard. The marker is the prescribed form for newly guarded tests.The report that prompted this named three tests;
test_incumbent_and_candidate_h5_loaders_preserve_scored_contractfails identically (sameload_artifactpath), so it gets the same marker.Verification
4 failed, 12 passed; now12 passed, 4 skippedwith reason "requires policyengine-us extra"uv sync --all-packages --extra us:16 passeduv run ruff checkclean;uv run python tools/ci_test_groups.py --verify→verification=okruff formatdivergence at line ~181 of this file (present onmain; CI runsruff checkonly)🤖 Generated with Claude Code