pytest使用fixture参数化

import pytest

#parametrize参数化
@pytest.mark.parametrize("A", [1, 2, 3, 4, 5])
def test_A(A):
    assert A > 3


#fixture参数化
B = [1, 2, 3, 4, 5]
ids = ['a','b','c','d','e']

@pytest.fixture(params=B,ids=ids)
def get_B():
    return B

def test_B(get_B):
    assert get_B>3
原文地址:https://www.cnblogs.com/nicole-zhang/p/11390263.html