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


相关推荐
摘星编程5 天前
AI 帮我写单测:pytest 覆盖率提升 40% 的协作日志
人工智能·pytest·测试驱动开发·代码覆盖率·ai协作开发
lucia_zl8 天前
pytest并发测试,资源问题导致用例失败解决办法
pytest
鱼鱼说测试8 天前
Selenium4+Pytest自动化测试框架实战
pytest
XYiFfang14 天前
【Pytest】解决Pytest中Teardown钩子的TypeError:实例方法与类方法的调用差异
python·pytest
Kingairy16 天前
Pytest 插件:pytest_runtest_protocol
python·pytest
AIZHINAN16 天前
Pytest 插件介绍和开发
测试工具·pytest·插件开发
灰阳阳18 天前
替身演员的艺术:pytest-mock 从入门到飙戏
自动化测试·python·pytest·unit testing·pytest-mock
年年测试21 天前
Playwright与PyTest结合指南
pytest
focksorCr22 天前
pytest 并发执行用例(基于受限的测试资源)
python·pytest