diff --git a/tests/test_core.py b/tests/test_core.py index 7ae2b82..67f17fe 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -3,9 +3,11 @@ proper test functions with tmp_path/monkeypatch fixtures).""" import json import os +import re import sys import urllib.error import urllib.request +from pathlib import Path import pytest @@ -1187,8 +1189,12 @@ def test_restart_claude_desktop_linux_refuses_without_touching_processes(monkeyp # --------------------------------------------------------------------------- # def test_dunder_version_matches_pyproject(): # Guards against the version drifting out of sync between the two places - # a human might bump it. - assert c.__version__ == "1.2.0" + # a human might bump it. Reads pyproject.toml rather than hard-coding a + # version here (which would make this a third place to bump). + text = (Path(__file__).parent.parent / "pyproject.toml").read_text(encoding="utf-8") + m = re.search(r'^version\s*=\s*"([^"]+)"', text, re.MULTILINE) + assert m, "no [project] version found in pyproject.toml" + assert c.__version__ == m.group(1) def test_parse_version_basic():