<12>pytest:pytest-ordering
目录:测试自动化学习 - pytest
说明:本篇博客基于pytest 6.2.5
作用
控制用例执行顺序
安装
pip install pytest-ordering
使用
装饰器:@pytest.mark.run(order=执行顺序)
注:
- 优先执行order装饰的用例
- 由小到大依次执行order用例
import pytest
import pytest_ordering
def test_case():
assert True
@pytest.mark.run(order=1)
def test_ordering1():
assert True
@pytest.mark.run(order=3)
def test_ordering3():
assert True
@pytest.mark.run(order=2)
def test_ordering2():
assert True


浙公网安备 33010602011771号