Skip to content

Commit

Permalink
update version match for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantinstadler committed Dec 12, 2023
1 parent b5f9df0 commit 089e26f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def test_version_consistency():
"""Test CHANGELOG.md latest version consistency with module version"""
# Assumption: version info is in a header line (starting with #)
# We capture the version info in the second group
version_match = re.compile(r"(#*.*)(\d+\.\d+\.\d+[a-zA-Z0-9_.]*)")
version_match = re.compile(r"(#*\s+)(\d+(\.\d+)*([a-zA-Z]+\d*)?)")

with open(CHANGELOG_FILE, "r") as cf:
for line in cf:
pot_match = re.match(version_match, line)
Expand All @@ -31,4 +32,4 @@ def test_version_consistency():
raise ValueError("No version information found in the CHANGELOG file")
assert (
coco.__version__ == version_changelog
), f"Version module({coco.__version__}) - CHANGELOG.rst do not match({version_changelog})"
), f"Version module({coco.__version__}) - do not match CHANGELOG version ({version_changelog})"

0 comments on commit 089e26f

Please sign in to comment.