From 18941b045f8e8ddc98740bf07217c2e89c4c1718 Mon Sep 17 00:00:00 2001 From: Denis Anikin Date: Tue, 26 Sep 2023 05:10:20 +0300 Subject: [PATCH] Automatic version parsing --- pyproject.toml | 2 +- tests/test_various_views.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4410f35..04947c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "spellcheck-microservice" -version = "3.2.0" +version = "4.0.0" description = "Microservice for spellchecking" authors = ["Denis Anikin "] license = "MIT" diff --git a/tests/test_various_views.py b/tests/test_various_views.py index 464cf85..8baa12b 100644 --- a/tests/test_various_views.py +++ b/tests/test_various_views.py @@ -1,6 +1,8 @@ import typing -from whole_app.settings import SETTINGS +import toml + +from whole_app.settings import PATH_TO_PYPROJECT, SETTINGS if typing.TYPE_CHECKING: @@ -10,4 +12,4 @@ def test_healthcheck_api_good(app_client: "TestClient") -> typing.Any: server_response = app_client.get(f"{SETTINGS.api_prefix}/health/") assert server_response.status_code == 200 - assert server_response.json()["version"] == "3.2.0" + assert server_response.json()["version"] == toml.loads(PATH_TO_PYPROJECT.read_text())["tool"]["poetry"]["version"]