summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Laxalde <denis@laxalde.org>2017-06-08 22:11:14 +0200
committerDenis Laxalde <denis@laxalde.org>2017-06-08 22:11:14 +0200
commit2ec1affc8ba1f48a6d7f95522b6f5d91d205727d (patch)
tree5a2d99df3be9b25325d9a5234a8222d8724d1c17
parentc8af2b376cc0a3648e8778f5384281669467ef20 (diff)
downloadjsonschema-2ec1affc8ba1f48a6d7f95522b6f5d91d205727d.tar.gz
Dedent examples in validate.rst to fix sphinx doctest
-rw-r--r--docs/validate.rst36
1 files changed, 18 insertions, 18 deletions
diff --git a/docs/validate.rst b/docs/validate.rst
index 83bb784..6d65263 100644
--- a/docs/validate.rst
+++ b/docs/validate.rst
@@ -87,9 +87,9 @@ classes should adhere to.
:rtype: bool
- >>> schema = {"maxItems" : 2}
- >>> Draft3Validator(schema).is_valid([2, 3, 4])
- False
+ >>> schema = {"maxItems" : 2}
+ >>> Draft3Validator(schema).is_valid([2, 3, 4])
+ False
.. method:: iter_errors(instance)
@@ -97,16 +97,16 @@ classes should adhere to.
:rtype: an iterable of :exc:`ValidationError`\s
- >>> schema = {
- ... "type" : "array",
- ... "items" : {"enum" : [1, 2, 3]},
- ... "maxItems" : 2,
- ... }
- >>> v = Draft3Validator(schema)
- >>> for error in sorted(v.iter_errors([2, 3, 4]), key=str):
- ... print(error.message)
- 4 is not one of [1, 2, 3]
- [2, 3, 4] is too long
+ >>> schema = {
+ ... "type" : "array",
+ ... "items" : {"enum" : [1, 2, 3]},
+ ... "maxItems" : 2,
+ ... }
+ >>> v = Draft3Validator(schema)
+ >>> for error in sorted(v.iter_errors([2, 3, 4]), key=str):
+ ... print(error.message)
+ 4 is not one of [1, 2, 3]
+ [2, 3, 4] is too long
.. method:: validate(instance)
@@ -114,11 +114,11 @@ classes should adhere to.
:raises: :exc:`ValidationError` if the instance is invalid
- >>> schema = {"maxItems" : 2}
- >>> Draft3Validator(schema).validate([2, 3, 4])
- Traceback (most recent call last):
- ...
- ValidationError: [2, 3, 4] is too long
+ >>> schema = {"maxItems" : 2}
+ >>> Draft3Validator(schema).validate([2, 3, 4])
+ Traceback (most recent call last):
+ ...
+ ValidationError: [2, 3, 4] is too long
All of the :ref:`versioned validators <versioned-validators>` that