Skip to content

Commit 926d404

Browse files
karlwaldmanclaude
andcommitted
test: version guard reads pyproject instead of a hard-coded literal
test_package_version_helper_reads_the_project_version asserted the literal '1.12.8', so it failed on this release for a reason unrelated to what it guards. Its job is 'does the helper report the PROJECT version', not 'is the version 1.12.8'. Now reads the expected value from pyproject.toml, so it keeps testing the helper and stops needing a hand-edit every release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JKAExynd9zoKwt6rYA66EA
1 parent b8b8301 commit 926d404

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎tests/test_release_readiness.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ def test_package_version_helper_reads_the_project_version() -> None:
170170
capture_output=True,
171171
text=True,
172172
)
173-
assert result.stdout.strip() == "1.12.8"
173+
# Read the expected value from pyproject rather than hard-coding it. The
174+
# helper's job is "does it report the PROJECT version", not "is the version
175+
# 1.12.8" — pinning the literal made this test fail on every release for a
176+
# reason unrelated to what it guards.
177+
pyproject = (ROOT / "pyproject.toml").read_text()
178+
expected = re.search(r'^version = "([^"]+)"', pyproject, re.M).group(1)
179+
assert result.stdout.strip() == expected
174180

175181

176182
def test_every_workflow_pins_actions_and_hardens_each_checkout_step() -> None:

0 commit comments

Comments
 (0)