美文网首页
(七)pytest常用参数

(七)pytest常用参数

作者: Sandra_liu | 来源:发表于2021-07-28 20:47 被阅读0次

    1、查看pytest常用参数

    pytest --help
    

    2、常用参数

    --collect-only :查看用例数量
    
    image.png

    -k: 关键字匹配,用and区分:匹配范围(模块名、类名、函数名)

    pytest -k  "login_002"  ./test_pytest/test_login.py
    
    image.png

    -m:分组

    pytest -m mmm  ./test_pytest/test_login.py
    
    image.png

    --maxfail=num:失败后尝试次数

    -s: 输出任何符合标准的输出流信息(显示程序中的print/logging输出)

    -v:输出的信息更详细(丰富信息模式, 输出更详细的用例执行信息)

    -q:简化输出信息(安静模式, 不输出环境信息)

    --version:查看当前pytest版本以及安装目录

    相关文章

      网友评论

          本文标题:(七)pytest常用参数

          本文链接:https://www.haomeiwen.com/subject/caramltx.html