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
diff --git a/src/txpkgupload/tests/filesystem.txt b/src/txpkgupload/tests/filesystem.txt
index afafca8..52f9dac 100644
--- a/src/txpkgupload/tests/filesystem.txt
+++ b/src/txpkgupload/tests/filesystem.txt
@@ -178,9 +178,7 @@ sorted orders for comparison.
178 ... # doesn't care about the sort order of the dictionaries.178 ... # doesn't care about the sort order of the dictionaries.
179 ... return sorted(ls_infos, key=itemgetter('name'))179 ... return sorted(ls_infos, key=itemgetter('name'))
180180
181 >>> expected.sort()
182 >>> returned = ufs.ls(".")181 >>> returned = ufs.ls(".")
183 >>> returned.sort()
184 >>> sorted_listings(expected) == sorted_listings(returned)182 >>> sorted_listings(expected) == sorted_listings(returned)
185 True183 True
186184
@@ -201,15 +199,12 @@ returns a true value.
201 ... if i["name"] == "foo":199 ... if i["name"] == "foo":
202 ... filtered_expected = [i];200 ... filtered_expected = [i];
203 >>> returned = ufs.ls(".", always_true_filter)201 >>> returned = ufs.ls(".", always_true_filter)
204 >>> returned.sort()
205 >>> sorted_listings(expected) == sorted_listings(returned)202 >>> sorted_listings(expected) == sorted_listings(returned)
206 True203 True
207 >>> returned = ufs.ls(".", always_false_filter)204 >>> returned = ufs.ls(".", always_false_filter)
208 >>> returned.sort()
209 >>> returned == []205 >>> returned == []
210 True206 True
211 >>> returned = ufs.ls(".", arbitrary_filter)207 >>> returned = ufs.ls(".", arbitrary_filter)
212 >>> returned.sort()
213 >>> sorted_listings(filtered_expected) == sorted_listings(returned)208 >>> sorted_listings(filtered_expected) == sorted_listings(returned)
214 True209 True
215 >>> for i in [ "foo", "bar" ]:210 >>> for i in [ "foo", "bar" ]:

Subscribers

People subscribed via source and target branches

to all changes: