pytest使用多个fixture

@pytest.fixture()
def some_A():
    return 1

@pytest.fixture()
def some_B(some_A):
    return some_A+1

@pytest.fixture()
def some_C(some_A,some_B):
    return some_A+some_B

def test_some(some_C):
    assert some_C==3

猜你喜欢

转载自www.cnblogs.com/nicole-zhang/p/11390244.html