Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 12, 2022
1 parent 562eb51 commit 1b6228a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion changelog.d/951.change.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
validators._in() now includes the default argument
"verbose_value_error=False". If set to True, the
ValueError raised in _InValidator includes the attribute,
options and value in addition to the error message.
options and value in addition to the error message.
8 changes: 2 additions & 6 deletions tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,7 @@ def test_fail(self):
a = simple_attr("test")
with pytest.raises(ValueError) as e:
v(None, a, None)
assert (
"'test' must be in [1, 2, 3] (got None)",
) == e.value.args
assert ("'test' must be in [1, 2, 3] (got None)",) == e.value.args

def test_fail_verbose(self):
"""
Expand All @@ -500,9 +498,7 @@ def test_fail_with_string(self):
a = simple_attr("test")
with pytest.raises(ValueError) as e:
v(None, a, None)
assert (
"'test' must be in 'abc' (got None)",
) == e.value.args
assert ("'test' must be in 'abc' (got None)",) == e.value.args

def test_fail_with_string_verbose(self):
"""
Expand Down

0 comments on commit 1b6228a

Please sign in to comment.