pytest--接口自动化测试

2022-04-28  本文已影响0人  sandy测试路

处理用例关联和依赖

参数化@pytest.mark.parametrize()

@pytest.mark.parametrize("identity, password", [("11", "11"), ("22", "22")])
def test_login_fail(identity, password):
    data = {
        "identity": identity,
        "password": password,
        "pid": "65edCTyg"
    }
    res = requests.post(url+"/tiger/v3/web/accounts/login", json=data)
    assert res.status_code == 403
    assert res.json()["error_code"] == "AC3_2"
    assert res.json()["error_message"] == "用户不存在或者密码错误"
上一篇下一篇

猜你喜欢

热点阅读