From e60552790090421289c5bc31db4bcf8edc736bbd Mon Sep 17 00:00:00 2001 From: passthem Date: Sat, 7 Mar 2026 16:25:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6e5cdc0..b58ccc7 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,21 @@ poetry run python bot.py - [事件处理](https://nonebot.dev/docs/tutorial/handler) - [Alconna 插件](https://nonebot.dev/docs/best-practice/alconna/) -## 数据库模块 +## 代码测试 -本项目的数据库模块已更新为异步实现,使用连接池来提高性能,并支持现代的`pathlib.Path`参数类型。详细使用方法请参考[数据库使用文档](/docs/database.md)。 +本项目使用 pytest 进行自动化测试,你可以把你的测试代码放在 `./tests` 目录下。 + +使用命令行执行测试: + +```bash +poetry run just test +``` + +使用命令行,在浏览器查看测试覆盖率报告: + +```bash +poetry run just coverage +# 此时会打开一个 :8000 端口的 Web 服务器 +# 你可以在 http://localhost:8000 查看覆盖率报告 +# 在控制台使用 Ctrl+C 关闭这个 Web 服务器 +```