Skip to content

Commit 0d76e80

Browse files
committed
Update test_dx.py
1 parent 8ad8f7c commit 0d76e80

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/test_dx.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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."""

0 commit comments

Comments
 (0)