Skip to content

Order hosts in parametrized tests #707

@tacerus

Description

@tacerus

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions