# third-part-api **Repository Path**: litcpu/third-part-api ## Basic Information - **Project Name**: third-part-api - **Description**: ............. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-03 - **Last Updated**: 2026-06-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 一起装 third-party API pytest 测试 ## 安装依赖 ```powershell pip install -r requirements-test.txt ``` ## 配置 复制 `.env.example` 为 `.env.local`,填写测试环境配置: ```powershell Copy-Item .env.example .env.local ``` 至少需要配置: - `YQZ_BASE_URL` - `YQZ_TOKEN` ## 运行测试 执行全部测试: ```powershell pytest ``` 执行某个测试文件: ```powershell pytest tests/home/request/test_get_device_status.py ``` 执行某个目录下的全部测试: ```powershell pytest tests/home/request ``` 执行某个测试函数: ```powershell pytest tests/home/request/test_get_device_status.py::test_get_device_status ``` 只执行上传接口: ```powershell pytest -m upload ``` 只执行流程接口: ```powershell pytest -m flow ``` 只收集用例,不真正执行请求: ```powershell pytest --collect-only -q ``` ## Allure 报告 项目已集成 `allure-pytest`。执行 pytest 后会自动清空上次报告,并生成 Allure 原始结果: ```text reports/allure-results ``` 同时会自动生成静态 Allure 报告: ```text reports/allure-report ``` 打开静态 Allure 报告: ```powershell allure open reports/allure-report ``` 如果只想临时查看原始结果: ```powershell allure serve reports/allure-results ``` 手动重新生成静态报告: ```powershell allure generate reports/allure-results -o reports/allure-report --clean ``` ## 编码检查 项目统一使用 UTF-8。修改包含中文的文件后,可以执行: ```powershell python scripts\check_encoding.py ```