Merge ~cjwatson/launchpad:py3-blueprints-doctest-unicode-strings into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 809a15fdebf4bb8a2ce1c23695a2cd6da1fa2d55
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-blueprints-doctest-unicode-strings
Merge into: launchpad:master
Diff against target: 188 lines (+41/-32)
7 files modified
lib/lp/blueprints/browser/tests/sprintattendance-views.txt (+3/-2)
lib/lp/blueprints/doc/specgraph.txt (+2/-2)
lib/lp/blueprints/doc/specification-notifications.txt (+8/-8)
lib/lp/blueprints/doc/specification.txt (+9/-8)
lib/lp/blueprints/doc/specificationmessage.txt (+4/-4)
lib/lp/blueprints/doc/sprint-meeting-export.txt (+10/-6)
lib/lp/blueprints/stories/sprints/xx-sprints.txt (+5/-2)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+396824@code.launchpad.net

Commit message

lp.blueprints: Fix u'...' doctest examples for Python 3

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/blueprints/browser/tests/sprintattendance-views.txt b/lib/lp/blueprints/browser/tests/sprintattendance-views.txt
2index ea15513..98f835a 100644
3--- a/lib/lp/blueprints/browser/tests/sprintattendance-views.txt
4+++ b/lib/lp/blueprints/browser/tests/sprintattendance-views.txt
5@@ -88,8 +88,9 @@ you wanted the meeting's start and end dates respectively.
6 Sample Person is now listed as an attendee.
7
8 >>> ubz = getUtility(ISprintSet)['ubz']
9- >>> [attendee.name for attendee in ubz.attendees]
10- [u'name12']
11+ >>> for attendee in ubz.attendees:
12+ ... print(attendee.name)
13+ name12
14
15 >>> sprint_attendance = ubz.attendances[0]
16
17diff --git a/lib/lp/blueprints/doc/specgraph.txt b/lib/lp/blueprints/doc/specgraph.txt
18index 86d678a..3a57d6e 100644
19--- a/lib/lp/blueprints/doc/specgraph.txt
20+++ b/lib/lp/blueprints/doc/specgraph.txt
21@@ -281,8 +281,8 @@ The SpecificationTreeImageTag view is indirectly called when the spec's
22 >>> page_view.initialize()
23 >>> content = page_view.render()
24 >>> image_start = content.find('<map id="deptree"')
25- >>> content[image_start:image_start + 33]
26- u'<map id="deptree" name="deptree">'
27+ >>> print(content[image_start:image_start + 33])
28+ <map id="deptree" name="deptree">
29
30
31 renderGraphvizGraph() error handling
32diff --git a/lib/lp/blueprints/doc/specification-notifications.txt b/lib/lp/blueprints/doc/specification-notifications.txt
33index 06c387e..097cf25 100644
34--- a/lib/lp/blueprints/doc/specification-notifications.txt
35+++ b/lib/lp/blueprints/doc/specification-notifications.txt
36@@ -40,14 +40,14 @@ the approver, Cprov, and the drafter, Robert.
37 ... subscription.person for subscription in svg_support.subscriptions]
38 >>> related_people_addresses = [
39 ... [person.preferredemail.email] for person in set(related_people)]
40- >>> for addr in sorted(related_people_addresses): print(addr)
41- [u'andrew.bennetts@ubuntulinux.com']
42- [u'carlos@canonical.com']
43- [u'celso.providelo@canonical.com']
44- [u'daf@canonical.com']
45- [u'foo.bar@canonical.com']
46- [u'robertc@robertcollins.net']
47- [u'stuart.bishop@canonical.com']
48+ >>> for addr in sorted(related_people_addresses): print(pretty(addr))
49+ ['andrew.bennetts@ubuntulinux.com']
50+ ['carlos@canonical.com']
51+ ['celso.providelo@canonical.com']
52+ ['daf@canonical.com']
53+ ['foo.bar@canonical.com']
54+ ['robertc@robertcollins.net']
55+ ['stuart.bishop@canonical.com']
56
57 >>> sent_addresses = sorted(
58 ... [to_addrs for from_addr, to_addrs, message in stub.test_emails])
59diff --git a/lib/lp/blueprints/doc/specification.txt b/lib/lp/blueprints/doc/specification.txt
60index 92d8382..47b6121 100644
61--- a/lib/lp/blueprints/doc/specification.txt
62+++ b/lib/lp/blueprints/doc/specification.txt
63@@ -38,8 +38,8 @@ To retrieve a specification by its ID, we use `ISpecificationSet.get`.
64
65 It should be possible to retrieve a specification by its name
66
67- >>> upstream_firefox.getSpecification('mng').name
68- u'mng'
69+ >>> print(upstream_firefox.getSpecification('mng').name)
70+ mng
71
72 And if we try to retrieve a non-existent specification we should get
73 None
74@@ -49,8 +49,9 @@ None
75
76 It's also possible to retrieve a specification by its URL
77
78- >>> specset.getByURL('http://developer.mozilla.org/en/docs/SVG').specurl
79- u'http://developer.mozilla.org/en/docs/SVG'
80+ >>> print(specset.getByURL(
81+ ... 'http://developer.mozilla.org/en/docs/SVG').specurl)
82+ http://developer.mozilla.org/en/docs/SVG
83
84 And if there's no specification with the given URL we should get None
85
86@@ -392,8 +393,8 @@ when we do.
87 >>> e4x.goal is not None
88 True
89
90- >>> e4x.goal_proposer.name
91- u'jdub'
92+ >>> print(e4x.goal_proposer.name)
93+ jdub
94
95 >>> e4x.date_goal_proposed is not None
96 True
97@@ -415,8 +416,8 @@ We can then accept the goal.
98 >>> e4x.goalstatus.title
99 'Accepted'
100
101- >>> e4x.goal_decider.name
102- u'mark'
103+ >>> print(e4x.goal_decider.name)
104+ mark
105
106 >>> e4x.date_goal_decided is not None
107 True
108diff --git a/lib/lp/blueprints/doc/specificationmessage.txt b/lib/lp/blueprints/doc/specificationmessage.txt
109index cbeaa9e..d5d944f 100644
110--- a/lib/lp/blueprints/doc/specificationmessage.txt
111+++ b/lib/lp/blueprints/doc/specificationmessage.txt
112@@ -21,8 +21,8 @@ ISpecificationMessageSet.createMessage:
113 ... content="text message content",
114 ... owner=factory.makePerson(),
115 ... spec=factory.makeSpecification())
116- >>> test_message.message.subject
117- u'test message subject'
118+ >>> print(test_message.message.subject)
119+ test message subject
120
121
122 Retrieving specification messages
123@@ -35,5 +35,5 @@ ISpecificationMessageSet.get:
124 >>> from zope.security.proxy import removeSecurityProxy
125 >>> specmessage_one = specmessageset.get(
126 ... removeSecurityProxy(test_message).id)
127- >>> specmessage_one.message.subject
128- u'test message subject'
129+ >>> print(specmessage_one.message.subject)
130+ test message subject
131diff --git a/lib/lp/blueprints/doc/sprint-meeting-export.txt b/lib/lp/blueprints/doc/sprint-meeting-export.txt
132index ea315da..51cc5b3 100644
133--- a/lib/lp/blueprints/doc/sprint-meeting-export.txt
134+++ b/lib/lp/blueprints/doc/sprint-meeting-export.txt
135@@ -74,9 +74,11 @@ The person does not show up as interested in the spec though. Only the
136 specification assignee is listed (the drafter would be too if one was
137 assigned).
138
139- >>> sorted(person['name']
140- ... for person in view.specifications[1]['interested'])
141- [u'carlos']
142+ >>> from operator import itemgetter
143+ >>> for person in sorted(
144+ ... view.specifications[1]['interested'], key=itemgetter('name')):
145+ ... print(person['name'])
146+ carlos
147
148 This is because sample person has not registered as an attendee of the
149 sprint. If we add them as an attendee, then they will be available:
150@@ -91,9 +93,11 @@ sprint. If we add them as an attendee, then they will be available:
151 >>> login(ANONYMOUS)
152 >>> view = getMultiAdapter((ubz, request), name='+temp-meeting-export')
153 >>> view.initialize()
154- >>> sorted(person['name']
155- ... for person in view.specifications[1]['interested'])
156- [u'carlos', u'name12']
157+ >>> for person in sorted(
158+ ... view.specifications[1]['interested'], key=itemgetter('name')):
159+ ... print(person['name'])
160+ carlos
161+ name12
162
163 The person is also included in the list of attendees:
164
165diff --git a/lib/lp/blueprints/stories/sprints/xx-sprints.txt b/lib/lp/blueprints/stories/sprints/xx-sprints.txt
166index bd0e5c9..5203299 100644
167--- a/lib/lp/blueprints/stories/sprints/xx-sprints.txt
168+++ b/lib/lp/blueprints/stories/sprints/xx-sprints.txt
169@@ -450,6 +450,7 @@ drivers, owners, and admins.
170
171 First, we add a couple of IRC nicknames for Carlos.
172
173+ >>> from operator import attrgetter
174 >>> from lp.testing import login, logout
175 >>> from zope.component import getUtility
176 >>> from lp.registry.interfaces.person import IPersonSet
177@@ -462,8 +463,10 @@ First, we add a couple of IRC nicknames for Carlos.
178 >>> IrcID(person=carlos, network='QuakeNet', nickname='qarlos')
179 <IrcID at ...>
180
181- >>> sorted([ircid.nickname for ircid in carlos.ircnicknames])
182- [u'carlos', u'qarlos']
183+ >>> for ircid in sorted(carlos.ircnicknames, key=attrgetter('nickname')):
184+ ... print(ircid.nickname)
185+ carlos
186+ qarlos
187
188 >>> logout()
189

Subscribers

People subscribed via source and target branches

to status/vote changes: