Skip to content

Commit b0fd434

Browse files
committed
assert that path exists
1 parent a5f1ff7 commit b0fd434

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang_tools/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,5 @@ def parse_version(version: str) -> Tuple[int]:
116116
try:
117117
return tuple([int(x) for x in version_tuple])
118118
except ValueError:
119+
assert Path(version).exists(), "specified version is not a semantic or a path"
119120
return (0, 0, 0)

tests/test_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ def test_get_sha(monkeypatch: pytest.MonkeyPatch):
4343

4444
def test_version_path():
4545
"""Tests version parsing when given specification is a path."""
46-
version = "some/path/to/bin/folder"
46+
version = str(Path(__file__).parent)
4747
assert parse_version(version) == (0, 0, 0)

0 commit comments

Comments
 (0)