Skip to content

Commit 2d6271a

Browse files
committed
test(utility): make sure version is updated
1 parent 3381d1b commit 2d6271a

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pytest-cov = "^5.0.0"
5454
pytest-replay = "^1.5.2"
5555
pytest-rerunfailures = "^14.0"
5656
pytest-dependency = "^0.6.0"
57+
tomli = "^2.0.2"
5758

5859
[tool.poetry.group.docs.dependencies]
5960
mkdocs = "^1.6.0"

tests/test_utility.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
from datetime import date, datetime, timezone
2+
from pathlib import Path
23

34
import pytest
5+
import tomli
46

7+
from toggl_api import __version__
58
from toggl_api.utility import format_iso, get_workspace, parse_iso, requires
69

710

11+
@pytest.mark.unit
12+
def test_version():
13+
with (Path.cwd() / "pyproject.toml").open("rb") as pyproject:
14+
pyversion = tomli.load(pyproject)["tool"]["poetry"]["version"]
15+
16+
assert __version__ == pyversion
17+
18+
819
@pytest.mark.unit
920
def test_format_iso():
1021
iso = format_iso(datetime.now(tz=timezone.utc))

0 commit comments

Comments
 (0)