Skip to content

Commit ebcc368

Browse files
committed
Alter test_prompt_for_keyring_if_needed to make sure we test the default is auto.
1 parent aebc0c5 commit ebcc368

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/functional/test_install_config.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def auth_needed(request: pytest.FixtureRequest) -> bool:
370370
return request.param
371371

372372

373-
@pytest.fixture(params=("disabled", "import", "subprocess", "auto"))
373+
@pytest.fixture(params=(None, "disabled", "import", "subprocess", "auto"))
374374
def keyring_provider(request: pytest.FixtureRequest) -> str:
375375
return request.param
376376

@@ -389,17 +389,20 @@ def flags(
389389
keyring_provider_implementation: str,
390390
) -> List[str]:
391391
if (
392-
keyring_provider != "auto"
392+
keyring_provider not in [None, "auto"]
393393
and keyring_provider_implementation != keyring_provider
394394
):
395395
pytest.skip()
396396

397-
flags = ["--keyring-provider", keyring_provider]
397+
flags = []
398+
if keyring_provider is not None:
399+
flags.append("--keyring-provider")
400+
flags.append(keyring_provider)
398401
if not interactive:
399402
flags.append("--no-input")
400403
if auth_needed:
401404
if keyring_provider_implementation == "disabled" or (
402-
not interactive and keyring_provider == "auto"
405+
not interactive and keyring_provider in [None, "auto"]
403406
):
404407
request.applymarker(pytest.mark.xfail())
405408
return flags
@@ -441,7 +444,10 @@ def test_prompt_for_keyring_if_needed(
441444
virtualenv = virtualenv_factory(workspace.joinpath("venv"))
442445
script = script_factory(workspace.joinpath("venv"), virtualenv, environ=environ)
443446

444-
if keyring_provider != "auto" or keyring_provider_implementation != "subprocess":
447+
if (
448+
keyring_provider not in [None, "auto"]
449+
or keyring_provider_implementation != "subprocess"
450+
):
445451
script.pip(
446452
"install",
447453
"keyring",

0 commit comments

Comments
 (0)