pytest 命令的常用参数使用说明

一、pytest -h  (或 pytest --help)   查看pytest命令帮助文档

@1.参数:--lf 和 --ff

--lf, --last-failed 只重新运行上次运行失败的用例(或如果没有失败的话会全部跑)
--ff, --failed-first 运行所有测试,但首先运行上次运行失败的测试
命令举例: pytest --lf

@2.参数:-v 或 -q   打印用例执行的详细/简略过程,pytest -v ,pytest -q

@3.参数:-s    运行过程中执行print打印函数:pytest -s

 

posted @ 2022-02-09 11:00  明天有盼望  阅读(213)  评论(0编辑  收藏  举报