Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order hosts in parametrized tests #707

Open
tacerus opened this issue Jun 18, 2023 · 0 comments
Open

Order hosts in parametrized tests #707

tacerus opened this issue Jun 18, 2023 · 0 comments
Labels

Comments

@tacerus
Copy link
Contributor

tacerus commented Jun 18, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants