From 089e26ff3766571e83d0d5cc46d0df1941c38578 Mon Sep 17 00:00:00 2001 From: Konstantin Stadler Date: Tue, 12 Dec 2023 20:45:11 +0100 Subject: [PATCH] update version match for tests --- tests/test_admin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_admin.py b/tests/test_admin.py index 7008025..1d471d2 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -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) @@ -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})"