Skip to content

Commit 9b13e1b

Browse files
committed
Match the update error on its type, not on CPython's wording
PyPy 3.10 words the dict.update error for a second positional argument differently. The test only needs the TypeError.
1 parent 3e81909 commit 9b13e1b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎_python_utils_tests/test_containers.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,12 +838,13 @@ def test_casted_dict_update_keyword_precedence() -> None:
838838

839839

840840
def test_casted_dict_update_single_positional() -> None:
841-
"""Reject a second positional argument with the ``dict.update`` error."""
841+
"""Reject a second positional argument like ``dict.update`` does."""
842842
values: containers.CastedDict[int, int] = containers.CastedDict(int, int)
843843
first: typing.Any = {'1': '2'}
844844
second: typing.Any = {'3': '4'}
845845

846-
with pytest.raises(TypeError, match='update expected at most 1 arg'):
846+
# The message is the interpreter's own and differs on PyPy.
847+
with pytest.raises(TypeError, match='update'):
847848
values.update(first, second)
848849
assert values == {}
849850

0 commit comments

Comments
 (0)