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

 

相关文章:

  • 2022-12-23
  • 2022-02-15
  • 2023-02-07
  • 2021-04-28
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-01-27
猜你喜欢
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2023-01-10
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
相关资源
相似解决方案