0
点赞
收藏
分享

微信扫一扫

pytest.mark.parametrize多参数同时使用提示names : must be equal to the number of values

鱼板番茄 2023-05-25 阅读 63

需求:abcd四个参数组合传入作为一条case

参数化如下:

@pytest.mark.parametrize("a,b,c,d", [data_a, data_b, data_c, data_d])

运行时提示

the number of names (4):

  [a, b, c, d]

must be equal to the number of values (5):

  data_a

原因貌似是没有将[]内的数据识别成一个整体,改为在数据外围加一层括号,成功:

@pytest.mark.parametrize("a,b,c,d", [(data_a, data_b, data_c, data_d)])

举报

相关推荐

0 条评论