Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/ruru/base/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@


@overload
def match_arg(
arg: str | Iterable[str], choices: list[str], *, several_ok: Literal[False] = False
) -> str: ...
def match_arg(arg: str, choices: list[str], *, several_ok: Literal[False] = False) -> str: ...
@overload
def match_arg(
arg: str | Iterable[str], choices: list[str], *, several_ok: Literal[True]
Expand Down
4 changes: 2 additions & 2 deletions tests/ruru/base/test_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_match_arg_list_input_several_ok_false(self, standard_choices):
"""Test list input with several_ok=False raises error."""
error_msg = "Iterable input is only allowed when several_ok=True"
with pytest.raises(ValueError, match=error_msg):
match_arg(["ban", "app"], standard_choices, several_ok=False)
match_arg(["ban", "app"], standard_choices, several_ok=False) # type: ignore[call-overload]

def test_match_arg_list_with_ambiguous_element(self, partial_match_choices):
"""Test list with ambiguous element returns all matches when several_ok=True."""
Expand Down Expand Up @@ -233,7 +233,7 @@ def test_match_arg_tuple_input_several_ok_false(self, standard_choices):
"""Test tuple input with several_ok=False raises error."""
error_msg = "Iterable input is only allowed when several_ok=True"
with pytest.raises(ValueError, match=error_msg):
match_arg(("ban", "app"), standard_choices, several_ok=False)
match_arg(("ban", "app"), standard_choices, several_ok=False) # type: ignore[call-overload]

def test_match_arg_empty_tuple(self, standard_choices):
"""Test empty tuple input returns empty list."""
Expand Down
Loading