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
相關文章
相關標籤/搜索