test: 后端 pytest 测试基建 (Phase0) — 6 用例全绿 + 部署前备份SOP合规
This commit is contained in:
1 parent
9e9c506ba9
commit
13578ba4c2
7 files changed
+89
No files matched your search
@@ -0,0 +1,12 @@
|
||||
"""Pytest 根配置:保证测试运行时 backend 包根目录在 sys.path 中。
|
||||
|
||||
运行方式(容器内,使用项目 venv):
|
||||
cd /app/backend/python
|
||||
/app/backend/python/.venv/bin/python -m pytest
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
|
||||
ROOT = os.path.dirname(os.path.abspath(__file__))
|
||||
if ROOT not in sys.path:
|
||||
sys.path.insert(0, ROOT)
|
||||
Reference in new issue
Block a user