From f24cfb96ebccb8596ba6d3e1e6b2affb7fa52629 Mon Sep 17 00:00:00 2001 From: Dos Moonen Date: Fri, 8 Apr 2022 21:41:19 +0200 Subject: [PATCH] Parameterized tests/functional/test_install_config.py::test_prompt_for_keyring_if_needed to add a few --no-input and --force-keyring scenarios --- tests/functional/test_install_config.py | 28 +++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/functional/test_install_config.py b/tests/functional/test_install_config.py index 65daa1d8f65..7156345889d 100644 --- a/tests/functional/test_install_config.py +++ b/tests/functional/test_install_config.py @@ -360,18 +360,34 @@ def auth_needed(request: pytest.FixtureRequest) -> bool: @pytest.fixture( params=( - False, - True, + (False, False, False), + (False, True, False), + (True, True, False), + (True, False, True), + ), + ids=( + "default-default", + "default-force_keyring", + "no_input-force_keyring", + "no_input-default", ), - ids=("default", "no_input"), ) -def flags(request: pytest.FixtureRequest) -> typing.List[str]: - no_input = request.param # type: ignore[attr-defined] +def flags(request: pytest.FixtureRequest, auth_needed: bool) -> typing.List[str]: + ( + no_input, + force_keyring, + xfail, + ) = request.param # type: ignore[attr-defined] flags = [] if no_input: flags.append("--no-input") - + if force_keyring: + flags.append( + "--force-keyring", + ) + if auth_needed and xfail: + request.applymarker(pytest.mark.xfail()) return flags