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 天前
博客论坛技术迭代
python·pytest
2601_962078232 天前
Python接口自动化流程(pytest)
python·pytest·接口自动化·测试框架·断言
杨女士YRJ2 天前
python+pytest+01
python·pytest
2601_962078233 天前
Python接口自动化框架:pytest
python·pytest·接口自动化·测试框架·restfulapi
2601_962078193 天前
Appium+Python+pytest自动化测试框架详解
自动化测试·python·appium·pytest·移动应用
2601_962284505 天前
安卓APP UI自动化测试:Python + UiAutomator2 + pytest + pytest-html
python·pytest·uiautomator2·ui自动化测试·安卓app
2601_962300815 天前
基于pytest的接口自动化测试:使用requests模块的实战项目与接口关联方法详解
接口自动化测试·测试用例·pytest·接口关联·requests模块
2601_962300815 天前
Python + Requests + Pytest + Excel + Allure:接口自动化测试项目实战
python·excel·pytest·allure·requests
11路没有终点6 天前
Pytest 安装、版本与第一个测试用例
测试用例·pytest
11路没有终点7 天前
pytest 参数化与 Mark 标记
pytest