pbls/requirements-test.txt
2026-09-22 22:03:22 +08:00

24 lines
1.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# pbls 应用 —— 测试前置依赖(发现项 DISC.2)
#
# 为什么单列一份、不并进 requirements.txt:
# requirements.txt 是**运行时**依赖,会被 build.sh 装进生产/测试 venv 并随应用
# 部署;pytest 只在「跑测试」这一步需要,混进去等于把测试工具塞进生产镜像。
# 因此本文件由 build.sh **第 7b 步**单独安装(可用 PBL_SKIP_TEST_DEPS=1 跳过),
# 不进入运行时依赖核验清单(第 5 步只核验 ahserver/sqlor/apppublic/appbase/rbac/PyMySQL)。
#
# 为什么必须显式声明:
# 测试机宿主 python3 未装 pytest,`python3 -m pytest` 直接
# `No module named pytest`;此前靠临时注入 PYTHONPATH=<workspace>/.pylibs 跑通
# (一次性手段,换机器/换角色即失效),test 角色据此会误判「用例失败/环境不可用」。
# 宿主 user site(/d/pipeline/.local)在本机是只读文件系统,`pip install --user`
# 也会失败,所以「让 pytest 可用」的正确落点是 venv,而不是宿主 python3。
#
# 用法(三条都是真实可执行路径,与 apps/pbls/README.md「测试依赖(DISC.2)」一致):
# 1) bash build.sh # 第 7b 步自动 pip install -r 本文件到 venv
# source venv/bin/activate && python3 -m pytest <目标> -v
# 2) python3 -m pip install -r requirements-test.txt # 自己管环境时(需可写 site)
# 3) bash modules/pbl_evidence/scripts/run_tests.sh # 模块自带引导(无 pytest 时自动建 .venv-test)
#
# 版本区间与各模块 pyproject [project.optional-dependencies].test 一致(>=7.0,<10)。
pytest>=7.0,<10