From 4ad34689294a9dd905e47d8f32bd12475982e7d6 Mon Sep 17 00:00:00 2001 From: "agent.develop" Date: Tue, 22 Sep 2026 21:50:13 +0800 Subject: [PATCH] =?UTF-8?q?deliver:=20=E4=BA=A4=E4=BB=98=E6=94=B6=E5=8F=A3?= =?UTF-8?q?=EF=BC=88=E5=BC=95=E6=93=8E=E4=BB=A3=E4=B8=BA=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-test.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 requirements-test.txt diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 0000000..dca604b --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1,18 @@ +# pbls 应用 —— 测试前置依赖(发现项 DISC.2) +# +# 为什么单列一份、不并进 requirements.txt: +# requirements.txt 是**运行时**依赖,会被 build.sh 装进生产/测试 venv 并随应用 +# 部署;pytest 只在「跑测试」这一步需要,混进去等于把测试工具塞进生产镜像。 +# +# 为什么必须显式声明: +# 测试机宿主 python3 未装 pytest,`python3 -m pytest` 直接 +# `No module named pytest`;此前靠临时注入 PYTHONPATH=/.pylibs 跑通 +# (一次性手段,换机器/换角色即失效),test 角色据此会误判「用例失败/环境不可用」。 +# +# 用法(build.sh 第 7b 步已自动执行): +# python3 -m pip install -r requirements-test.txt +# 或 bash scripts/build.sh # venv 内即有 pytest +# 或 cd modules/pbl_evidence && bash scripts/run_tests.sh # 模块自带引导 +# +# 版本区间与各模块 pyproject [project.optional-dependencies].test 一致(>=7.0,<10)。 +pytest>=7.0,<10