Skip to content

Commit 2ec1aff

Browse files
committed
Dedent examples in validate.rst to fix sphinx doctest
1 parent c8af2b3 commit 2ec1aff

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

docs/validate.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,38 +87,38 @@ classes should adhere to.
8787

8888
:rtype: bool
8989

90-
>>> schema = {"maxItems" : 2}
91-
>>> Draft3Validator(schema).is_valid([2, 3, 4])
92-
False
90+
>>> schema = {"maxItems" : 2}
91+
>>> Draft3Validator(schema).is_valid([2, 3, 4])
92+
False
9393

9494
.. method:: iter_errors(instance)
9595

9696
Lazily yield each of the validation errors in the given instance.
9797

9898
:rtype: an iterable of :exc:`ValidationError`\s
9999

100-
>>> schema = {
101-
... "type" : "array",
102-
... "items" : {"enum" : [1, 2, 3]},
103-
... "maxItems" : 2,
104-
... }
105-
>>> v = Draft3Validator(schema)
106-
>>> for error in sorted(v.iter_errors([2, 3, 4]), key=str):
107-
... print(error.message)
108-
4 is not one of [1, 2, 3]
109-
[2, 3, 4] is too long
100+
>>> schema = {
101+
... "type" : "array",
102+
... "items" : {"enum" : [1, 2, 3]},
103+
... "maxItems" : 2,
104+
... }
105+
>>> v = Draft3Validator(schema)
106+
>>> for error in sorted(v.iter_errors([2, 3, 4]), key=str):
107+
... print(error.message)
108+
4 is not one of [1, 2, 3]
109+
[2, 3, 4] is too long
110110

111111
.. method:: validate(instance)
112112

113113
Check if the instance is valid under the current :attr:`schema`.
114114

115115
:raises: :exc:`ValidationError` if the instance is invalid
116116

117-
>>> schema = {"maxItems" : 2}
118-
>>> Draft3Validator(schema).validate([2, 3, 4])
119-
Traceback (most recent call last):
120-
...
121-
ValidationError: [2, 3, 4] is too long
117+
>>> schema = {"maxItems" : 2}
118+
>>> Draft3Validator(schema).validate([2, 3, 4])
119+
Traceback (most recent call last):
120+
...
121+
ValidationError: [2, 3, 4] is too long
122122

123123

124124
All of the :ref:`versioned validators <versioned-validators>` that

0 commit comments

Comments
 (0)