Skip to content

Commit ba0e17e

Browse files
committed
test(utils): improve version testing
1 parent ef83b6f commit ba0e17e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_utility.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import subprocess # noqa: S404
12
from datetime import date, datetime, timezone
23
from pathlib import Path
34

@@ -15,6 +16,15 @@ def test_version():
1516

1617
assert __version__ == pyversion
1718

19+
git_tag = subprocess.run( # noqa: S603
20+
["git", "describe", "--abbrev=0", "--tags"], # noqa: S607
21+
stdout=subprocess.PIPE,
22+
check=True,
23+
text=True,
24+
).stdout.strip()[1:]
25+
26+
assert __version__ == git_tag
27+
1828

1929
@pytest.mark.unit
2030
def test_format_iso():

0 commit comments

Comments
 (0)