Resolve param indices using param values, not parameterset index by sadra-barikbin · Pull Request #11257 · pytest-dev/pytest (original) (raw)
To compute param indices smarter when user passes multiple parameter sets with duplicate values to parametrize
in order to have a better reordering experience. Currently we have :
@pytest.fixture(scope='module') def fixture1(request): pass
@pytest.fixture(scope='module') def fixture2(request): pass
@pytest.mark.parametrize("fixture1, fixture2", [("a", 0), ("b", 1), ("a", 2)], indirect=True) def test(fixture1, fixture2): pass
resulting in inefficient ordering i.e.
<Function test[a-0]>
<Function test[b-1]>
<Function test[a-2]>
It's a follow-up to #11220 .