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
3 changes: 3 additions & 0 deletions CHANGES/1295.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed a missing space in the :exc:`ValueError` message
raised when constructing a multidict from a sequence
-- by :user:`veeceey`.
2 changes: 1 addition & 1 deletion multidict/_multidict_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ def _parse_args(
for pos, item in enumerate(arg):
if not len(item) == 2:
raise ValueError(
f"multidict update sequence element #{pos}"
f"multidict update sequence element #{pos} "
f"has length {len(item)}; 2 is required"
)
identity = identity_func(item[0])
Expand Down
5 changes: 4 additions & 1 deletion tests/test_multidict.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,10 @@ def test_cannot_create_from_unaccepted(
self,
cls: type[MutableMultiMapping[str]],
) -> None:
with pytest.raises(ValueError, match="multidict update sequence element"):
with pytest.raises(
ValueError,
match=r"^multidict update sequence element #0 has length 3; 2 is required$",
):
cls([(1, 2, 3)]) # type: ignore[call-arg]

def test_keys_is_set_less(self, cls: type[MultiDict[str]]) -> None:
Expand Down
Loading