Skip to content

Commit caa70bd

Browse files
vosesoftclaude
andcommitted
Fix CI: stop hard-coding version in test_version_is_set
The boot test asserted __version__ == "0.3.6"; the 0.3.7 bump made it stale and CI on main went red (the local run had passed because the suite ran before the version bump). Assert the version is set and PEP 440-ish instead, so future release bumps don't require editing this test. Release + Integration workflows were unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b299c32 commit caa70bd

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tests/unit/test_server_boot.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
import re
2+
13
import pytest
24

35
from modelrisk_mcp import __version__
46
from modelrisk_mcp.server import mcp
57

68

79
def test_version_is_set() -> None:
8-
assert __version__ == "0.3.6"
10+
# Don't hard-code the literal — that turns every release bump into a
11+
# required test edit (and a red CI when it's forgotten). Assert the
12+
# version is set and PEP 440-ish instead.
13+
assert isinstance(__version__, str)
14+
assert re.fullmatch(r"\d+\.\d+\.\d+([.-]?[A-Za-z0-9.]+)?", __version__), (
15+
f"__version__ not a valid version string: {__version__!r}"
16+
)
917

1018

1119
def test_server_name() -> None:

0 commit comments

Comments
 (0)