From 8cf19d43c45bbc3a3e09d863efd45e6580026224 Mon Sep 17 00:00:00 2001 From: Cowork Supervisor Date: Sun, 12 Jul 2026 13:32:23 -0400 Subject: [PATCH] test: version-sync test reads pyproject.toml instead of hard-coding Co-Authored-By: Claude Fable 5 --- tests/test_core.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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():