launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #25866
[Merge] ~cjwatson/launchpad:py3-branchcollection-sorting-test into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-branchcollection-sorting-test into launchpad:master.
Commit message:
Fix TestBranchCollectionConvertListingSortToOrderBy for Python 3
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/395366
Comparing two iterators returned by map is awkward, but we can just use list comprehensions instead.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-branchcollection-sorting-test into launchpad:master.
diff --git a/lib/lp/code/model/tests/test_branchcollection.py b/lib/lp/code/model/tests/test_branchcollection.py
index 0ddfbba..35fce20 100644
--- a/lib/lp/code/model/tests/test_branchcollection.py
+++ b/lib/lp/code/model/tests/test_branchcollection.py
@@ -1419,7 +1419,9 @@ class TestBranchCollectionConvertListingSortToOrderBy(TestCase):
"""Assert that one list of sort specs is equal to another."""
def sort_data(sort):
return sort.suffix, sort.expr
- self.assertEqual(map(sort_data, sort_one), map(sort_data, sort_two))
+ self.assertEqual(
+ [sort_data(sort) for sort in sort_one],
+ [sort_data(sort) for sort in sort_two])
def test_default(self):
"""Test that passing None or DEFAULT results in the default list."""