Merge lp:~xnox/subunit/hash-ordering into lp:~subunit/subunit/trunk

Proposed by Dimitri John Ledkov on 2012-10-27
Status: Superseded
Proposed branch: lp:~xnox/subunit/hash-ordering
Merge into: lp:~subunit/subunit/trunk
Diff against target: 56 lines (+8/-6)
2 files modified
python/subunit/__init__.py (+2/-2)
python/subunit/tests/test_test_protocol.py (+6/-4)
To merge this branch: bzr merge lp:~xnox/subunit/hash-ordering
Reviewer Review Type Date Requested Status
Dimitri John Ledkov (community) Needs Fixing on 2012-10-27
Barry Warsaw 2012-10-27 Pending
Subunit Developers 2012-10-27 Pending
Review via email: mp+131732@code.launchpad.net
To post a comment you must log in.
Dimitri John Ledkov (xnox) wrote :

This was not enough to build in Raring.

review: Needs Fixing
lp:~xnox/subunit/hash-ordering updated on 2012-10-30
177. By Dimitri John Ledkov on 2012-10-30

Use or expect ordered results, fixes FTBFS with python3.3's order randomisation.

Unmerged revisions

177. By Dimitri John Ledkov on 2012-10-30

Use or expect ordered results, fixes FTBFS with python3.3's order randomisation.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python/subunit/__init__.py'
2--- python/subunit/__init__.py 2012-05-07 22:19:16 +0000
3+++ python/subunit/__init__.py 2012-10-30 23:03:21 +0000
4@@ -772,7 +772,7 @@
5 return
6 tags = set([tag.encode('utf8') for tag in new_tags])
7 tags.update([_b("-") + tag.encode('utf8') for tag in gone_tags])
8- tag_line = _b("tags: ") + _b(" ").join(tags) + _b("\n")
9+ tag_line = _b("tags: ") + _b(" ").join(sorted(tags)) + _b("\n")
10 self._stream.write(tag_line)
11
12 def time(self, a_datetime):
13@@ -798,7 +798,7 @@
14 if parameters:
15 self._stream.write(_b(";"))
16 param_strs = []
17- for param, value in parameters.items():
18+ for param, value in sorted(parameters.items()):
19 param_strs.append("%s=%s" % (param, value))
20 self._stream.write(_b(",".join(param_strs)))
21 self._stream.write(_b("\n%s\n" % name))
22
23=== modified file 'python/subunit/tests/test_test_protocol.py'
24--- python/subunit/tests/test_test_protocol.py 2012-03-25 14:38:54 +0000
25+++ python/subunit/tests/test_test_protocol.py 2012-10-30 23:03:21 +0000
26@@ -14,6 +14,7 @@
27 # limitations under that license.
28 #
29
30+from collections import OrderedDict
31 import datetime
32 import unittest
33 import os
34@@ -1134,9 +1135,10 @@
35 self.io = BytesIO()
36 self.protocol = subunit.TestProtocolClient(self.io)
37 self.test = TestTestProtocolClient("test_start_test")
38- self.sample_details = {'something':Content(
39- ContentType('text', 'plain'), lambda:[_b('serialised\nform')])}
40- self.sample_tb_details = dict(self.sample_details)
41+ self.sample_details = OrderedDict([
42+ ('something', Content(ContentType('text', 'plain'),
43+ lambda:[_b('serialised\nform')]))])
44+ self.sample_tb_details = OrderedDict(self.sample_details)
45 self.sample_tb_details['traceback'] = TracebackContent(
46 subunit.RemoteError(_u("boo qux")), self.test)
47
48@@ -1311,7 +1313,7 @@
49
50 def test_tags_both(self):
51 self.protocol.tags(set(['quux']), set(['bar']))
52- self.assertEqual(_b("tags: quux -bar\n"), self.io.getvalue())
53+ self.assertEqual(_b("tags: -bar quux\n"), self.io.getvalue())
54
55 def test_tags_gone(self):
56 self.protocol.tags(set(), set(['bar']))

Subscribers

People subscribed via source and target branches