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

 

posted @ 2019-08-21 17:57  OTAKU_nicole  阅读(977)  评论(0编辑  收藏  举报