pytest脚本常用的执行命令

pytest脚本常用的执行命令

一、一般执行的脚本,执行.py文件整个脚本

bash 复制代码
 pytest -vs D:\python_test\pythonProject\t2ests\tes22t_productGroup.py
pytest -vs  脚本的地址

二、执行.py文件脚本中的一个模块

bash 复制代码
 pytest -vs D:\python_test\pythonProject\t2ests\tes22t_productGroup.py -K  "test_create_tic"
pytest -vs  脚本的地址 -K "模块名"

三、执行脚本,执行.py文件整个脚本,或则一个模块,查看对应的日志信息

3.1.py文件执行allure的脚本

bash 复制代码
3.1 整个脚本执行allure命令
pytest -vs D:\python_test\pythonProject\tests\test_productGroup.py   --alluredir=allure_results

3.21个脚本下的1个模块执行allure命令
pytest -vs D:\python_test\pythonProject\t2ests\tes22t_productGroup.py -K  "test_create_tic"  --alluredir=allure_results


pytest -vs 脚本地址 (-K  "test_create_tic" ) --alluredir=allure_results(allure_results是脚本名称,可以自己自定义) 如果要执行对应的模块就带-K,不执行就不带

3.2去dos框下去执行对应的脚本信息

bash 复制代码
allure serve D:\python_test\pythonProject\allure_results


相关推荐
Be reborn1 小时前
用 Playwright 做自动化测试:如何验证网络请求并做断言
网络·python·自动化·pytest
lifewange2 天前
pytest 找不到文件?直接在 pytest.ini 配置根目录 + 路径(最简单方案)
开发语言·python·pytest
老神在在0012 天前
保姆级教程:Pytest + Allure 接口自动化测试从 0 到 1 完整指南(含环境搭建、用例编写、报告生成、报错排坑全流程)
pycharm·pytest·测试
清水白石0082 天前
从手写初始化到 pytest fixture:让 Python 测试既干净、可复用,又能驾驭异步并发
开发语言·python·pytest
测试员周周2 天前
【AI测试数据及模型质量2】换一批测试数据,模型得分差20%——AI评测翻车的根子,90%在数据质量
人工智能·python·ui·单元测试·测试用例·集成测试·pytest
nbwenren10 天前
2026实测:Gemini 3.1 Pro 从需求文档到 pytest 测试用例一条龙教程
测试用例·pytest
我的xiaodoujiao11 天前
API 接口自动化测试详细图文教程学习系列16--项目实战演练3
python·学习·测试工具·pytest
我的xiaodoujiao11 天前
API 接口自动化测试详细图文教程学习系列15--项目实战演练2
python·学习·测试工具·pytest
技术钱12 天前
PyTest配置与API测试用例
servlet·测试用例·pytest