diff --git a/tests/unit/plugins/lookup/onepassword/test_onepassword.py b/tests/unit/plugins/lookup/onepassword/test_onepassword.py index 0a1f7d5861c..426f7f8aaff 100644 --- a/tests/unit/plugins/lookup/onepassword/test_onepassword.py +++ b/tests/unit/plugins/lookup/onepassword/test_onepassword.py @@ -151,6 +151,9 @@ def test_op_get_field(mocker, op_fixture, output, expected, request): assert result == expected +# This test sometimes fails on older Python versions because the gathered tests mismatch. +# Attempt to make this more reliable by creating deterministic IDs +# https://github.com/pytest-dev/pytest-xdist/issues/432 @pytest.mark.parametrize( ("cli_class", "vault", "queries", "kwargs", "output", "expected"), ( @@ -158,6 +161,10 @@ def test_op_get_field(mocker, op_fixture, output, expected, request): for _cli_class in MOCK_ENTRIES for item in MOCK_ENTRIES[_cli_class] ), + ids=[ + f"v{cls.supports_version}_{idx + 1}" for cls in MOCK_ENTRIES + for idx, value in enumerate(MOCK_ENTRIES[cls]) + ], ) def test_op_lookup(mocker, cli_class, vault, queries, kwargs, output, expected): mocker.patch("ansible_collections.community.general.plugins.lookup.onepassword.OnePass._get_cli_class", cli_class)