0
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)

Result:

Process finished with exit code 0
PASSED                            
[100%]['url1', 'url2', 'url3']
['xp1', 'xp2', 'xp3']

Target result:

PASSED                                [ 33%]url1 xp1
PASSED                                [ 66%]url2 xp2
PASSED                                [100%]url3 xp3

For one list it works with "@pytest.mark.parametrize("url", xlist)", but I didn't find something about multiple. Any solutions please?

Awave
  • 7
  • 5

1 Answers1

0
@pytest.mark.parametrize("url, xp", zip(xlist, ylist))
class Test01:
    def test_001(self, url, xp):
        print(url)
        print(xp)

I've looked for this.

Awave
  • 7
  • 5