Skip to content

Commit

Permalink
Sort by sorted(items()) instead of list(values()).
Browse files Browse the repository at this point in the history
This fixes a Python 3 test failure.
  • Loading branch information
rodrigc committed Feb 26, 2017
1 parent 622da50 commit 07261d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions master/buildbot/test/unit/test_www_rest.py
Expand Up @@ -258,8 +258,8 @@ def assertRestCollection(self, typeName, items,
# if order is not significant, sort so the comparison works
if not orderSignificant:
if 'content' in got and typeName in got['content']:
got['content'][typeName].sort(key=lambda x: list(x.values()))
exp['content'][typeName].sort(key=lambda x: list(x.values()))
got['content'][typeName].sort(key=lambda x: sorted(x.items()))
exp['content'][typeName].sort(key=lambda x: sorted(x.items()))
if 'meta' in got['content'] and 'links' in got['content']['meta']:
got['content']['meta']['links'].sort(
key=lambda l: (l['rel'], l['href']))
Expand Down

0 comments on commit 07261d8

Please sign in to comment.