Skip to content

Commit

Permalink
fix: Sort missing keys
Browse files Browse the repository at this point in the history
Merge pull request #117 from TBoshoven/patch-1
  • Loading branch information
skorokithakis authored Aug 6, 2016
2 parents 0444095 + e8f55f4 commit d4331a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ def validate(self, data):
required = set(k for k in s if type(k) is not Optional)
if not required.issubset(coverage):
missing_keys = required - coverage
s_missing_keys = ", ".join(repr(k) for k in missing_keys)
s_missing_keys = ', '.join(repr(k) for k in sorted(missing_keys,
key=repr))
raise SchemaMissingKeyError('Missing keys: ' + s_missing_keys, e)
if not self._ignore_extra_keys and (len(new) != len(data)):
wrong_keys = set(data.keys()) - set(new.keys())
Expand Down

0 comments on commit d4331a3

Please sign in to comment.