From 85342f149bc8c43eba535c817bc67fee0e7de28e Mon Sep 17 00:00:00 2001 From: whatevertogo Date: Thu, 19 Mar 2026 02:18:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(tests):=20=E6=B7=BB=E5=8A=A0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B=E4=BB=A5=E9=AA=8C=E8=AF=81=20regist?= =?UTF-8?q?er=5Ftask=20=E7=9A=84=E8=A1=8C=E4=B8=BA=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=B5=8B=E8=AF=95=E8=BF=90=E8=A1=8C=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 10 ++++++---- CLAUDE.md | 12 +++++++----- {tests_v4 => tests}/conftest.py | 0 {tests_v4 => tests}/test_context_register_task.py | 0 4 files changed, 13 insertions(+), 9 deletions(-) rename {tests_v4 => tests}/conftest.py (100%) rename {tests_v4 => tests}/test_context_register_task.py (100%) diff --git a/AGENTS.md b/AGENTS.md index 09b79652a..3de989e63 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,12 +41,14 @@ ruff check . --fix # 使用 ruff 检查并自动修复全局格式问题 如果修改了内容可能影响现有功能,请运行测试以确保没有引入错误: 如果修改了bug或者更改了功能需要添加新的测试 +当前仓库已统一使用 `tests/` 目录,`tests_v4/` 不再作为新增测试入口。 +仓库当前没有 `run_tests.py`,请直接使用 `pytest`。 ```bash -python run_tests.py # 运行所有测试 -python run_tests.py -v # 详细输出 -python run_tests.py -k "test_peer" # 运行匹配模式的测试 -python run_tests.py --cov # 运行测试并生成覆盖率报告 +python -m pytest tests -q # 运行 tests 目录全部测试 +python -m pytest tests -v # 详细输出 +python -m pytest tests -k "test_context_register_task" # 运行匹配模式的测试 +python -m pytest tests --cov=astrbot_sdk # 运行测试并生成覆盖率报告 ``` ## 设计原则 diff --git a/CLAUDE.md b/CLAUDE.md index de010b89c..45efe08cd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -41,12 +41,14 @@ ruff check . --fix # 使用 ruff 检查并自动修复全局格式问题 如果修改了内容可能影响现有功能,请运行测试以确保没有引入错误: 如果修改了bug或者更改了功能需要添加新的测试 +当前仓库已统一使用 `tests/` 目录,`tests_v4/` 不再作为新增测试入口。 +仓库当前没有 `run_tests.py`,请直接使用 `pytest`。 ```bash -python run_tests.py # 运行所有测试 -python run_tests.py -v # 详细输出 -python run_tests.py -k "test_peer" # 运行匹配模式的测试 -python run_tests.py --cov # 运行测试并生成覆盖率报告 +python -m pytest tests -q # 运行 tests 目录全部测试 +python -m pytest tests -v # 详细输出 +python -m pytest tests -k "test_context_register_task" # 运行匹配模式的测试 +python -m pytest tests --cov=astrbot_sdk # 运行测试并生成覆盖率报告 ``` ## 设计原则 @@ -57,4 +59,4 @@ python run_tests.py --cov # 运行测试并生成覆盖率报告 --- # currentDate -Today's date is 2026-03-14. +Today's date is 2026-03-19. diff --git a/tests_v4/conftest.py b/tests/conftest.py similarity index 100% rename from tests_v4/conftest.py rename to tests/conftest.py diff --git a/tests_v4/test_context_register_task.py b/tests/test_context_register_task.py similarity index 100% rename from tests_v4/test_context_register_task.py rename to tests/test_context_register_task.py