File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,18 @@ def test_three_line_demo(self):
8282 assert "heart_rate" in text and "casualty_report" in text and "evacuation" in text
8383
8484 def test_version (self ):
85+ # Single source of truth: __version__ must match what
86+ # importlib.metadata reports for the installed package, and must
87+ # be a valid PEP 440 version string. No hardcoded literals --
88+ # bumping the version in pyproject.toml should never require a
89+ # test update.
8590 from osmp import __version__
86- assert __version__ == "2.0.1"
91+ from importlib .metadata import version as pkg_version
92+ assert __version__ == pkg_version ("osmp" )
93+ assert isinstance (__version__ , str )
94+ assert len (__version__ ) > 0
95+ # Sanity check: version starts with a digit (PEP 440 form).
96+ assert __version__ [0 ].isdigit (), f"version { __version__ !r} not PEP 440"
8797
8898 def test_tier2_class_api (self ):
8999 """Tier 2: class-based, same results."""
You can’t perform that action at this time.
0 commit comments