調(diào)整執(zhí)行順序:
安裝:
- pip install pytest-ordering
用法:
- @pytest.mark.last
- @pytest.mark.run(order=1)
失敗后重新運(yùn)行:
安裝:
- pip install pytest-rerunfailures
用法:
- pytest -v --reruns 5 --reruns-delay 1 --- 每次等1秒乍钻,重跑5次
斷言失敗后繼續(xù)運(yùn)行:
安裝:
- pip install pytest-assume
用法:
- pytest.assume(1==2)
多線程湿刽、分布式運(yùn)行:
前提:
- 用例之間獨(dú)立,無(wú)先后順序
- 可重復(fù)運(yùn)行鹦肿,不影響其他用例
安裝:
- pip install pytest-xdist
用法:
- pytest -n num num個(gè)線程同時(shí)運(yùn)行
參考:https://blog.csdn.net/qq_42610167/article/details/101204066