diff --git a/voluptuous/schema_builder.py b/voluptuous/schema_builder.py index 8d7a81a..8a18821 100644 --- a/voluptuous/schema_builder.py +++ b/voluptuous/schema_builder.py @@ -1121,8 +1121,9 @@ class Inclusive(Optional): True """ - def __init__(self, schema, group_of_inclusion, msg=None): - super(Inclusive, self).__init__(schema, msg=msg) + def __init__(self, schema, group_of_inclusion, msg=None, description=None): + super(Inclusive, self).__init__(schema, msg=msg, + description=description) self.group_of_inclusion = group_of_inclusion diff --git a/voluptuous/tests/tests.py b/voluptuous/tests/tests.py index fa44fbf..6464d37 100644 --- a/voluptuous/tests/tests.py +++ b/voluptuous/tests/tests.py @@ -6,8 +6,8 @@ from nose.tools import assert_equal, assert_false, assert_raises, assert_true from voluptuous import ( - Schema, Required, Exclusive, Optional, Extra, Invalid, In, Remove, Literal, - Url, MultipleInvalid, LiteralInvalid, TypeInvalid, NotIn, Match, Email, + Schema, Required, Exclusive, Inclusive, Optional, Extra, Invalid, In, Remove, + Literal, Url, MultipleInvalid, LiteralInvalid, TypeInvalid, NotIn, Match, Email, Replace, Range, Coerce, All, Any, Length, FqdnUrl, ALLOW_EXTRA, PREVENT_EXTRA, validate, ExactSequence, Equal, Unordered, Number, Maybe, Datetime, Date, Contains, Marker, IsDir, IsFile, PathExists, SomeOf, TooManyValid, Self, @@ -1035,6 +1035,9 @@ def test_description(): exclusive = Exclusive('alpha', 'angles', description='Hello') assert exclusive.description == 'Hello' + inclusive = Inclusive('alpha', 'angles', description='Hello') + assert inclusive.description == 'Hello' + required = Required('key', description='Hello') assert required.description == 'Hello'