import pytest
#pip install pytest-ordering
#pip install pytest-rerunfailures
#修改函数的执行顺序
#都是负数,值越小越先执行
#0和负数,0先执行
#0>较小整数>较大整数>无标记>较小负数>较大负数
@pytest.mark.run(order=3)
def test_a():
print("\ntest_a")
assert 1
@pytest.mark.run(order=1)
def test_b():
print("\ntest_b")
assert 0
@pytest.mark.run(order=2)
def test_hello():
print("\nhello_test")
assert 1
if __name__ == '__mian__':
pytest.main("-s test_order.py")
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。