Skip to content

Commit 99ab125

Browse files
committed
fix: test for dynamic version
1 parent bc59a1e commit 99ab125

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/balatrobench/unit/test_cli.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import pytest
66

7+
from balatrobench import __version__
78
from balatrobench.cli import (
89
VERSION_PARTS_PATTERN,
910
VERSION_PATTERN,
@@ -81,7 +82,7 @@ def test_infer_version_nested(self, tmp_path: Path) -> None:
8182
# Path like /path/to/v1.0.0/subdir - the leaf is "subdir" not the version
8283
path = tmp_path / "v1.0.0" / "subdir"
8384
# Since the function only checks .name (the leaf), this returns default
84-
assert infer_version(path) == "v1.0.0" # Default fallback
85+
assert infer_version(path) == f"v{__version__}" # Default fallback
8586

8687
def test_infer_version_invalid(self) -> None:
8788
"""Returns default for non-versioned paths."""
@@ -92,7 +93,9 @@ def test_infer_version_invalid(self) -> None:
9293
Path("1.0.0"), # No 'v' prefix
9394
]
9495
for path in invalid_paths:
95-
assert infer_version(path) == "v1.0.0", f"{path} should return default"
96+
assert infer_version(path) == f"v{__version__}", (
97+
f"{path} should return default"
98+
)
9699

97100

98101
class TestVersionSortKey:

0 commit comments

Comments
 (0)