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


相关推荐
兴趣使然黄小黄7 小时前
【Pytest】Pytest常用的第三方插件
python·pytest
我的xiaodoujiao9 小时前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 34--基础知识 9--文件上传功能
前端·python·测试工具·ui·pytest
我一定会有钱10 小时前
pytest测试框架基础
python·单元测试·自动化·pytest
我的xiaodoujiao10 小时前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 35--二次封装MySQL数据库连接操作
python·学习·测试工具·pytest
给你一页白纸1 天前
Pytest 测试用例自动生成:接口自动化进阶实践
python·pytest·接口自动化
工会主席-阿冰1 天前
使用pytest-selenium插件,ui自动化示例
selenium·pytest
工会主席-阿冰1 天前
pytest,ui自动化示例
pytest·ui自动化
我一定会有钱3 天前
pytest基础
python·测试工具·测试用例·pytest
西游音月3 天前
(6)pytest+Selenium自动化测试-测试用例编写
selenium·测试用例·pytest
兴趣使然黄小黄5 天前
【Pytest】Pytest框架快速入门
python·pytest