pytest-testinfra icon indicating copy to clipboard operation
pytest-testinfra copied to clipboard

Order hosts in parametrized tests

Open tacerus opened this issue 2 years ago • 0 comments

Hi,

I use parameterized tests like these:

@pytest.mark.parametrize('parameter', parametermap)
def test_salt_state_apply(host, parameter):
  <some test code>

Right now, the tests run each parameter per host:

host0-parameter0
host0-parameter1
host1-parameter0
host1-parameter1

Is there a way to instead have them test each host per parameter?

host0-parameter0
host1-parameter0
host0-parameter1
host1-parameter1

I tried to stack a second parameterized decorator for host, however it would still loop over the "original" hosts passed using --hosts.

Would appreciate any ideas!

tacerus avatar Jun 18 '23 17:06 tacerus