summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Moore <p.f.moore@gmail.com>2023-04-10 12:43:20 +0100
committerGitHub <noreply@github.com>2023-04-10 12:43:20 +0100
commit62e932ad2889f370e47aeae010b5e2a23a194d38 (patch)
tree00931944873055171ddacb9486e7853175c89044 /tests
parentcd7aeb719adb33af65c15ed3e97456f90d9c7c7c (diff)
parent9605b97b48d10b56a00c885449bbc285d1bcd039 (diff)
downloadpip-62e932ad2889f370e47aeae010b5e2a23a194d38.tar.gz
Merge pull request #11942 from Darsstar/correct-keyring-provider-default
Correct keyring provider default
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/test_install_config.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/functional/test_install_config.py b/tests/functional/test_install_config.py
index 563b5604a..9f8a80677 100644
--- a/tests/functional/test_install_config.py
+++ b/tests/functional/test_install_config.py
@@ -370,7 +370,7 @@ def auth_needed(request: pytest.FixtureRequest) -> bool:
return request.param
-@pytest.fixture(params=("disabled", "import", "subprocess", "auto"))
+@pytest.fixture(params=(None, "disabled", "import", "subprocess", "auto"))
def keyring_provider(request: pytest.FixtureRequest) -> str:
return request.param
@@ -389,17 +389,20 @@ def flags(
keyring_provider_implementation: str,
) -> List[str]:
if (
- keyring_provider != "auto"
+ keyring_provider not in [None, "auto"]
and keyring_provider_implementation != keyring_provider
):
pytest.skip()
- flags = ["--keyring-provider", keyring_provider]
+ flags = []
+ if keyring_provider is not None:
+ flags.append("--keyring-provider")
+ flags.append(keyring_provider)
if not interactive:
flags.append("--no-input")
if auth_needed:
if keyring_provider_implementation == "disabled" or (
- not interactive and keyring_provider == "auto"
+ not interactive and keyring_provider in [None, "auto"]
):
request.applymarker(pytest.mark.xfail())
return flags
@@ -441,7 +444,10 @@ def test_prompt_for_keyring_if_needed(
virtualenv = virtualenv_factory(workspace.joinpath("venv"))
script = script_factory(workspace.joinpath("venv"), virtualenv, environ=environ)
- if keyring_provider != "auto" or keyring_provider_implementation != "subprocess":
+ if (
+ keyring_provider not in [None, "auto"]
+ or keyring_provider_implementation != "subprocess"
+ ):
script.pip(
"install",
"keyring",