Skip to content

Commit

Permalink
Add keyring option to failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
SnoopJ committed Jun 29, 2022
1 parent fd3e5ed commit aba9e96
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/unit/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ def has_option_no_index(command: Command) -> bool:

@pytest.mark.parametrize("command_name", EXPECTED_INDEX_GROUP_COMMANDS)
@pytest.mark.parametrize(
"disable_pip_version_check, no_index, expected_called",
"disable_pip_version_check, no_index, keyring, expected_called",
[
# pip_self_version_check() is only called when both
# disable_pip_version_check and no_index are False.
(False, False, True),
(False, True, False),
(True, False, False),
(True, True, False),
(False, False, False, True),
(False, True, False, False),
(True, False, False, False),
(True, True, False, False),
],
)
@mock.patch("pip._internal.cli.req_command.pip_self_version_check")
Expand All @@ -92,6 +92,7 @@ def test_index_group_handle_pip_version_check(
command_name: str,
disable_pip_version_check: bool,
no_index: bool,
keyring: bool,
expected_called: bool,
) -> None:
"""
Expand All @@ -103,6 +104,7 @@ def test_index_group_handle_pip_version_check(
options = command.parser.get_default_values()
options.disable_pip_version_check = disable_pip_version_check
options.no_index = no_index
options.keyring = keyring

command.handle_pip_version_check(options)
if expected_called:
Expand Down

0 comments on commit aba9e96

Please sign in to comment.