pytest命令行指定运行测试用例
目录如下:


1、指定文件夹运行
pytest dome/
2、指定模块运行
pytest test_dome_1.py
3、指定测试用例
pytest test_dome_1.py::test_one
4、模糊匹配
pytest -k "one"
#含有“one”文件名、类名、方法名都会被找到执行
5、标记(-m)

pytest -m dome
#运行所有文件下被标记了dome的用例
学习ing。。。

pytest命令行指定运行测试用例
目录如下:
pytest dome/
pytest test_dome_1.py
pytest test_dome_1.py::test_one
pytest -k "one"
#含有“one”文件名、类名、方法名都会被找到执行
pytest -m dome
#运行所有文件下被标记了dome的用例
学习ing。。。
本文标题:pytest (一):指定运行测试用例
本文链接:https://www.haomeiwen.com/subject/ajffyltx.html
网友评论