1、查看pytest常用参数
pytest --help
2、常用参数
--collect-only :查看用例数量

-k: 关键字匹配,用and区分:匹配范围(模块名、类名、函数名)
pytest -k "login_002" ./test_pytest/test_login.py

-m:分组
pytest -m mmm ./test_pytest/test_login.py

--maxfail=num:失败后尝试次数
-s: 输出任何符合标准的输出流信息(显示程序中的print/logging输出)
-v:输出的信息更详细(丰富信息模式, 输出更详细的用例执行信息)
-q:简化输出信息(安静模式, 不输出环境信息)
--version:查看当前pytest版本以及安装目录
网友评论