执行hiyoogrpc测试用例命令

badge_svr_test.py 执行命令

项目根目录:D:\study\project\hiyoo\chatchillgrpc

1. 首次运行(安装依赖)

Set-Location "D:\study\project\hiyoo\chatchillgrpc"
py -3.10 -m pip install -r ProjectPackage/requirements.txt

2. 运行全部用例(推荐)

Set-Location "D:\study\project\hiyoo\chatchillgrpc"
py -3.10 -m pytest testcases/user_svr/badge_svr_test.py -v

3. 运行单个用例

# 获取已获得勋章列表
py -3.10 -m pytest testcases/user_svr/badge_svr_test.py::TestBadge::test_get_obtained_list -v

# 获取佩戴的勋章列表
py -3.10 -m pytest testcases/user_svr/badge_svr_test.py::TestBadge::test_get_wear_list -v

4. 显示 print 输出

py -3.10 -m pytest testcases/user_svr/badge_svr_test.py -v -s

5. 生成 Allure 报告

py -3.10 -m pytest testcases/user_svr/badge_svr_test.py -v --alluredir=report/allure-results
allure serve report/allure-results

说明

  • 必须在项目根目录执行,保证 BaseApiCase 等模块能正确导入
  • 建议使用 py -3.10;若已配置好虚拟环境,也可直接用 pytest
image.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容