摘要: 1。 调整用例执行顺序 默认按名称顺序执行。安装pip install pytest-ordering, 在测试方法上加装饰器@pytest.mark.last @pytest.mark.run(order=1) 2。遇到错误停止执行 -x 参数 pytest -x -v -s test_01.py 阅读全文
posted @ 2021-05-07 19:14 Sunnyday21 阅读(127) 评论(0) 推荐(0)
摘要: pytest参数化与数据驱动实现—— 1. 使用@pytest.mark.parametrize进行参数化和数据驱动 import pytest @pytest.mark.parametrize("test_input, expected", [('3+5', 8), ('1+5', 6), ('3 阅读全文
posted @ 2021-05-07 16:46 Sunnyday21 阅读(234) 评论(0) 推荐(0)
摘要: 1. 安装pytest及其插件 pip install pytest pip install pytest-sugar(更好展示测试进度), pip install pytest-allure(生成报告), pip install pytest_xdist(多CPU分发,加快执行速度) 2.pych 阅读全文
posted @ 2021-05-07 13:29 Sunnyday21 阅读(115) 评论(0) 推荐(0)