pytest--用例執行

pytest退出執行:spa

一,用例失敗後退出執行code

pytest -x                   # 用例失敗1個後退出執行it

pytest --maxfail=2    # 用例失敗2個後退出執行class

 

pytest執行:test

pytest          # 執行全部用例裝飾器

pytest test_test.py     #按模塊執行標籤

pytest   testing/        #按包執行co

pytest -k    "add"     #按照關鍵字執行

pytest test_pytest.py::test_add    #模塊種的特定的用例

pytest -m slow        #按照標籤運行  用例上添加@pytest.mark.slow 裝飾器

相關文章
相關標籤/搜索