diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index b13d9e703..935d2b9a0 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -172,10 +172,7 @@ def get_parametrized_fixture_keys( callspec: CallSpec2 = item.callspec # type: ignore[attr-defined] except AttributeError: return - # cs.indices is random order of argnames. Need to - # sort this so that different calls to - # get_parametrized_fixture_keys will be deterministic. - for argname in sorted(callspec.indices): + for argname in callspec.indices: if callspec._arg2scope[argname] != scope: continue diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index 0fb5aa450..299e411a6 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -2730,12 +2730,12 @@ class TestFixtureMarker: """ test_dynamic_parametrized_ordering.py::test[flavor1-vxlan] PASSED test_dynamic_parametrized_ordering.py::test2[flavor1-vxlan] PASSED - test_dynamic_parametrized_ordering.py::test[flavor2-vxlan] PASSED - test_dynamic_parametrized_ordering.py::test2[flavor2-vxlan] PASSED - test_dynamic_parametrized_ordering.py::test[flavor2-vlan] PASSED - test_dynamic_parametrized_ordering.py::test2[flavor2-vlan] PASSED test_dynamic_parametrized_ordering.py::test[flavor1-vlan] PASSED test_dynamic_parametrized_ordering.py::test2[flavor1-vlan] PASSED + test_dynamic_parametrized_ordering.py::test[flavor2-vlan] PASSED + test_dynamic_parametrized_ordering.py::test2[flavor2-vlan] PASSED + test_dynamic_parametrized_ordering.py::test[flavor2-vxlan] PASSED + test_dynamic_parametrized_ordering.py::test2[flavor2-vxlan] PASSED """ )