xlist = ["url1", "url2", "url3"]
ylist = ["xp1", "xp2", "xp3"]
@pytest.mark.parametrize("url, xp", [(xlist, ylist)])
class Test01:
def test_001(self, url, xp):
print(url)
print(xp)
结果:
Process finished with exit code 0
PASSED
[100%]['url1', 'url2', 'url3']
['xp1', 'xp2', 'xp3']
目标结果:
PASSED [ 33%]url1 xp1
PASSED [ 66%]url2 xp2
PASSED [100%]url3 xp3
对于一个列表,它适用于“@pytest.mark.parametrize(“url”, xlist)”,但我没有找到关于多个的东西。请问有什么解决办法吗?
收到一只叮咚
相关分类