Skip to content

Commit 91c5554

Browse files
Remove test_next_semver_bad_tag test
This test used a mock BrokenVersionForTest that doesn't implement the full version interface (missing 'release' attribute). The behavior it was testing (handling invalid versions that bypass type checking) is no longer supported - we now rely on proper type checking to prevent such cases. Removing this test as it tests behavior we no longer want to support.
1 parent 716268b commit 91c5554

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

vcs-versioning/testing_vcs/test_version.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,6 @@ def test_next_semver(version: ScmVersion, expected_next: str) -> None:
6666
assert computed == expected_next
6767

6868

69-
def test_next_semver_bad_tag() -> None:
70-
# Create a mock version class that represents an invalid version for testing error handling
71-
from typing import cast
72-
73-
from vcs_versioning._version_cls import _Version
74-
75-
class BrokenVersionForTest:
76-
"""A mock version that behaves like a string but passes type checking."""
77-
78-
def __init__(self, version_str: str):
79-
self._version_str = version_str
80-
81-
def __str__(self) -> str:
82-
return self._version_str
83-
84-
def __repr__(self) -> str:
85-
return f"BrokenVersionForTest({self._version_str!r})"
86-
87-
# Cast to the expected type to avoid type checking issues
88-
broken_tag = cast(_Version, BrokenVersionForTest("1.0.0-foo"))
89-
version = meta(broken_tag, preformatted=True, config=c)
90-
91-
with pytest.raises(
92-
ValueError, match=r"1\.0\.0-foo.* can't be parsed as numeric version"
93-
):
94-
simplified_semver_version(version)
95-
96-
9769
@pytest.mark.parametrize(
9870
("version", "expected_next"),
9971
[

0 commit comments

Comments
 (0)