完成错误测试用例

This commit is contained in:
Your Name
2026-01-31 11:02:59 +08:00
parent 588e3bb478
commit 11cef531bd
15 changed files with 909 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
# 项目管理系统后端
依据《产品文档》与《API 文档》,Python + FastAPI 实现,TDD 开发。
## 目录结构
```
backend/
├── src/ # 后端源码
│ ├── __init__.py
│ └── app.py # FastAPI 应用与路由
├── tests/ # 测试用例
├── pytest.ini # pytest 配置(pythonpath = src
├── requirements.txt
└── API.md
```
## 运行测试
```bash
cd backend
source .venv/bin/activate
pytest tests/ -v
```
pytest 会通过 `pytest.ini``pythonpath = src` 自动把 `src` 加入 Python 路径,无需手动设置 PYTHONPATH。
## 启动服务
```bash
cd backend
source .venv/bin/activate
PYTHONPATH=src uvicorn app:app --reload --host 0.0.0.0 --port 8000
```
或进入 `src` 再启动:
```bash
cd backend/src
uvicorn app:app --reload --host 0.0.0.0 --port 8000
```