Skip to content

Commit

Permalink
add test and fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaCrotti committed Nov 6, 2016
1 parent 560a7c3 commit 434a25b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions voluptuous/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ def test_maybe():

s = Schema(Maybe(int))
assert s(1) == 1
assert s(None) is None

assert_raises(Invalid, s, 'foo')

Expand Down
2 changes: 1 addition & 1 deletion voluptuous/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def PathExists(v):
class Maybe(object):
"""Validate that the object is of a given type or is None.
:raises Invalid: if the value is not of the type declared or None
:raises Invalid: if the value is not of the type declared and is not None
>>> s = Schema(Maybe(int))
>>> s(10)
Expand Down

0 comments on commit 434a25b

Please sign in to comment.