对一个参数进行参数化

@pytest.mark.parametrize('password',["112312","123456","aqww12"])
def test_1(password):
    a  = lo.login_post("username",password)
    assert a== "用户名或密码错误"

对多个参数进行参数化

@pytest.mark.parametrize('user,password',[("test","112312"),("test3","123456"),("admin","aqww12")])
def test_1(user,password):
    a  = lo.login_post(user,password)
    assert a== "用户名或密码错误"

 

posted on 2019-11-20 17:44  阿宅gogo  阅读(288)  评论(0)    收藏  举报