Merge ~cjwatson/txpkgupload:py3-remove-unnecessary-sorts into txpkgupload:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: aebfe1eac1c5a93b11efdfd20410e30ed529dcb7
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/txpkgupload:py3-remove-unnecessary-sorts
Merge into: txpkgupload:master
Diff against target: 30 lines (+0/-5)
1 file modified
src/txpkgupload/tests/filesystem.txt (+0/-5)
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Review via email: mp+392889@code.launchpad.net

Commit message

Remove unnecessary .sort() calls in tests

Description of the change

These would need a "key" argument to work properly on Python 3, but they're also unnecessary since the following tests sort these lists again anyway.

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/txpkgupload/tests/filesystem.txt b/src/txpkgupload/tests/filesystem.txt
2index afafca8..52f9dac 100644
3--- a/src/txpkgupload/tests/filesystem.txt
4+++ b/src/txpkgupload/tests/filesystem.txt
5@@ -178,9 +178,7 @@ sorted orders for comparison.
6 ... # doesn't care about the sort order of the dictionaries.
7 ... return sorted(ls_infos, key=itemgetter('name'))
8
9- >>> expected.sort()
10 >>> returned = ufs.ls(".")
11- >>> returned.sort()
12 >>> sorted_listings(expected) == sorted_listings(returned)
13 True
14
15@@ -201,15 +199,12 @@ returns a true value.
16 ... if i["name"] == "foo":
17 ... filtered_expected = [i];
18 >>> returned = ufs.ls(".", always_true_filter)
19- >>> returned.sort()
20 >>> sorted_listings(expected) == sorted_listings(returned)
21 True
22 >>> returned = ufs.ls(".", always_false_filter)
23- >>> returned.sort()
24 >>> returned == []
25 True
26 >>> returned = ufs.ls(".", arbitrary_filter)
27- >>> returned.sort()
28 >>> sorted_listings(filtered_expected) == sorted_listings(returned)
29 True
30 >>> for i in [ "foo", "bar" ]:

Subscribers

People subscribed via source and target branches

to all changes: