Merge lp:~jameinel/launchpadlib/py27-config-ordering-1020667 into lp:launchpadlib

Proposed by John A Meinel
Status: Merged
Approved by: Martin Packman
Approved revision: 131
Merged at revision: 131
Proposed branch: lp:~jameinel/launchpadlib/py27-config-ordering-1020667
Merge into: lp:launchpadlib
Diff against target: 23 lines (+5/-5)
1 file modified
src/launchpadlib/docs/introduction.txt (+5/-5)
To merge this branch: bzr merge lp:~jameinel/launchpadlib/py27-config-ordering-1020667
Reviewer Review Type Date Requested Status
Martin Packman (community) Approve
Review via email: mp+113382@code.launchpad.net

Commit message

Don't rely on ConfigParser's ordering of content.

Description of the change

It appears that launchpadlib itself doesn't run most of the doctests. So we only run them when running the Launchpad test suite.

It turns out that python-2.7 changed the ordering of config file entries for ConfigParser.SafeConfigParser, which a test case was relying on. (It shoudn't have, as in 2.6 it was strictly 'iter(dict)' ordering, which only happened to be stable enough.)

The new ordering is actually stable (OrderedDict), but to be compatible with 2.6 and 2.7, I just switched to adding a sorted() call around it.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

Note, if this is approved, we'll want a new release of launchpadlib, so that we can update the Launchpad dependencies, so that we can get a clean test suite run of Launchpad for python-2.7.

Revision history for this message
Martin Packman (gz) wrote :

Looks reasonable to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/launchpadlib/docs/introduction.txt'
2--- src/launchpadlib/docs/introduction.txt 2011-01-06 13:37:16 +0000
3+++ src/launchpadlib/docs/introduction.txt 2012-07-04 11:44:19 +0000
4@@ -126,14 +126,14 @@
5 >>> encrypted_file = StringIO()
6 >>> stream = EncodedFile(encrypted_file, 'rot_13', 'ascii')
7 >>> credentials.save(stream)
8- >>> print encrypted_file.getvalue()
9+ >>> print ''.join(sorted(encrypted_file))
10 [1]
11+ <BLANKLINE>
12+ <BLANKLINE>
13+ npprff_frperg = grfg
14+ npprff_gbxra = fnytnqb-punatr-nalguvat
15 pbafhzre_frperg =
16- npprff_gbxra = fnytnqb-punatr-nalguvat
17 pbafhzre_xrl = ynhapucnq-yvoenel
18- npprff_frperg = grfg
19- <BLANKLINE>
20- <BLANKLINE>
21
22 >>> stream.seek(0)
23 >>> credentials = Credentials()

Subscribers

People subscribed via source and target branches