基于 Python Requests + Pytest + Allure 构建接口自动化测试框架的最优实践
以下是基于 Python Requests + Pytest + Allure 构建接口自动化测试框架的最优实现路径及关键问题思考:
一、框架架构设计
1. 目录结构规划
project/
├── config/ # 配置文件
│ ├── dev.yaml # 开发环境配置
│ ├── test.yaml # 测试环境配置
│ └── prod.yaml # 生产环境配置
├── test_cases/ # 测试用例集
│ ├── api/ # 接口测试模块
│ │ ├── __init__.py
│ │ ├── test_auth.py # 认证接口测试
│ │ └── test_order.py # 订单接口测试
│