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 装饰器

相关文章
相关标签/搜索