From 881d9b96e236315627985288895902d0d8a264ee Mon Sep 17 00:00:00 2001 From: Pnant <73925474+Panniantong@users.noreply.github.com> Date: Mon, 23 Mar 2026 18:42:14 +0800 Subject: [PATCH] fix(test): update doctor test assertions for Rich markup (#197) PR #170 added Rich markup tags to doctor output, but the test still asserted against plain text. Strip markup before assertion. Co-authored-by: Panniantong --- tests/test_doctor.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/test_doctor.py b/tests/test_doctor.py index 63d17f3..ddaa22b 100644 --- a/tests/test_doctor.py +++ b/tests/test_doctor.py @@ -90,9 +90,12 @@ class TestDoctor: } ) - assert "Agent Reach" in report - assert "✅ 装好即用:" in report - assert "搜索(mcporter 即可解锁):" in report - assert "配置后可用:" in report - assert "状态:1/3 个渠道可用" in report - assert "运行 `agent-reach setup` 解锁更多渠道" in report + # Strip Rich markup tags for assertion (PR #170 added [bold], [yellow] etc.) + import re + plain = re.sub(r"\[[^\]]*\]", "", report) + assert "Agent Reach" in plain + assert "装好即用:" in plain + assert "搜索(mcporter 即可解锁):" in plain + assert "配置后可用:" in plain + assert "1/3 个渠道可用" in plain + assert "agent-reach setup" in plain