summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/errors.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/errors.rst b/docs/errors.rst
index 4fd00a0..f965eda 100644
--- a/docs/errors.rst
+++ b/docs/errors.rst
@@ -62,7 +62,7 @@ These attributes can be clarified with a short example:
... }
>>> instance = [{}, 3, "foo"]
>>> v = Draft4Validator(schema)
- >>> errors = list(v.iter_errors(instance))
+ >>> errors = sorted(v.iter_errors(instance), key=lambda e: e.path)
The error messages in this situation are not very helpful on their own:
@@ -103,7 +103,7 @@ the schema each of these errors come from. In the case of sub-errors from the
.. code-block:: python
>>> for e in errors:
- ... for sube in e.context:
+ ... for sube in sorted(e.context, key=lambda e: e.schema_path:
... print list(sube.schema_path), sube
[0, 'type'] {} is not of type 'string'
[1, 'type'] {} is not of type 'integer'