运行命令
pytest -q test_**.py 静态模式
pytest -m pytest[,,,,] 调用pytest执行测试
pytest --version 显示版本
pytest --fixtures 显示内部函数
pytest -h|--help 显示帮助信息
pytest -x 第一次失败后停止
pytest --maxfail=2 第二次失败后停止
pytest **.py 运行文件内所有用例
pytest ****/ 运行目录内所有用例
pytest -k “**** not ****”按照包含的关键字运行对应内容
pytest test_mod.py::test_func 运行某个文件中独一个用例
pytest -m slow 通过mark标记运行测试
pytest --pyargs pkg.testing pytest --pyargs pkg.testing
pytest --durations=10 显示执行最慢的10条用例
pytest --junitxml=path 创建可有jenkins读取的xml测试报告
pytest --resultlog=path 创建结果日志文件
pytest --pastebin=failed 为失败用例建立日志url链接
pytest --pastebin=all 为整个测试执行日志建立一个连接
pytest -pno:doctest :禁用插件
pytest.main() 代码中直接调用pytest