Skip to content

Commit a4a2a44

Browse files
blarghmateyCopilot
andcommitted
Replace test_semantic_version with test_bump_my_version_format
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 90dc60c commit a4a2a44

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

micromasters/tests/test_settings.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
import sys
77
from unittest import mock
88

9-
import semantic_version
9+
import re
10+
import tomllib
11+
1012
from ddt import data, ddt
1113
from django.conf import settings
1214
from django.core import mail
@@ -152,9 +154,11 @@ def test_opensearch_index_pr_build(self):
152154
settings_vars = self.reload_settings()
153155
assert settings_vars['OPENSEARCH_INDEX'] == index_name
154156

155-
@staticmethod
156-
def test_semantic_version():
157-
"""
158-
Verify that we have a semantic compatible version.
159-
"""
160-
semantic_version.Version(settings.VERSION)
157+
def test_bump_my_version_format(self):
158+
"""Verify that VERSION matches the bump-my-version calver format."""
159+
with open("pyproject.toml", "rb") as f: # noqa: PTH123
160+
pyproject = tomllib.load(f)
161+
version_pattern = pyproject["tool"]["bumpversion"]["parse"]
162+
package_version = pyproject["project"]["version"]
163+
assert settings.VERSION == package_version
164+
assert re.fullmatch(version_pattern, settings.VERSION)

0 commit comments

Comments
 (0)