Skip to content

Commit

Permalink
Update attrs to 22.1.0 and fix test.
Browse files Browse the repository at this point in the history
The ValueError from InValidator has been augmented to include a lot of
other structured information that, for simplicity, we can ignore in the
test.
  • Loading branch information
tjni authored and Tinche committed Aug 14, 2022
1 parent e61f251 commit 290d162
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 35 deletions.
46 changes: 14 additions & 32 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ class Test:
with pytest.raises(ClassValidationError) as exc:
c.structure({"a": 1, "b": "c", "c": "1"}, Test)

assert repr(exc.value.exceptions[0]) == repr(
ValueError("'b' must be in ['a', 'b'] (got 'c')")
)
assert type(exc.value.exceptions[0]) == ValueError
assert str(exc.value.exceptions[0].args[0]) == "'b' must be in ['a', 'b'] (got 'c')"


def test_list_validation():
Expand Down

0 comments on commit 290d162

Please sign in to comment.