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


相关推荐
姚青&2 天前
软件测试基础概念
单元测试·pytest
爆更小哇5 天前
pytest集成Allure报告教程
python·测试工具·pytest·接口测试·allure
gCode Teacher 格码致知6 天前
Python提高:pytest的简单案例-由Deepseek产生
python·pytest
gCode Teacher 格码致知6 天前
Python提高: unittest和 pytest的使用方法-由Deepseek产生
开发语言·python·pytest
我的xiaodoujiao10 天前
API 接口自动化测试详细图文教程学习系列11--Requests模块3--测试练习
开发语言·python·学习·测试工具·pytest
我的xiaodoujiao10 天前
API 接口自动化测试详细图文教程学习系列12--Requests模块4--测试实践操作
python·学习·测试工具·pytest
Lightning-py12 天前
pytest 软断言的几种方式
pytest
Lightning-py12 天前
pytest后置处理方式
pytest
爆更小哇13 天前
Python自动化测试:pytest新手快速入门指南
python·测试工具·自动化·pytest
qq_4523962313 天前
第一篇:基座选型 —— 为什么 Pytest 是自动化的终点?
自动化·pytest