Merge ~cjwatson/launchpad:py3-doctest-set-repr into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 77b8b37fa6d7a6cd0990579511f2645a2b69f3b0
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-doctest-set-repr
Merge into: launchpad:master
Diff against target: 230 lines (+58/-39)
11 files modified
lib/lp/answers/doc/faq-vocabulary.txt (+2/-2)
lib/lp/app/widgets/doc/checkbox-matrix-widget.txt (+8/-4)
lib/lp/archiveuploader/tests/nascentuploadfile.txt (+3/-2)
lib/lp/bugs/doc/bug-tags.txt (+9/-6)
lib/lp/bugs/doc/product-update-remote-product.txt (+3/-3)
lib/lp/registry/browser/tests/milestone-views.txt (+3/-2)
lib/lp/registry/doc/person.txt (+3/-2)
lib/lp/registry/doc/product-widgets.txt (+3/-2)
lib/lp/services/mail/tests/incomingmail.txt (+4/-4)
lib/lp/soyuz/doc/gina.txt (+17/-10)
lib/lp/soyuz/doc/sourcepackagerelease.txt (+3/-2)
Reviewer Review Type Date Requested Status
Cristian Gonzalez (community) Approve
Review via email: mp+396934@code.launchpad.net

Commit message

Adjust doctests for repr of sets in Python 3

To post a comment you must log in.
Revision history for this message
Cristian Gonzalez (cristiangsp) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/answers/doc/faq-vocabulary.txt b/lib/lp/answers/doc/faq-vocabulary.txt
2index 968f320..933eb19 100644
3--- a/lib/lp/answers/doc/faq-vocabulary.txt
4+++ b/lib/lp/answers/doc/faq-vocabulary.txt
5@@ -24,8 +24,8 @@ collections:
6
7 >>> firefox_faqs = set(firefox.searchFAQs())
8 >>> vocabulary_faqs = set(term.value for term in vocabulary)
9- >>> firefox_faqs.symmetric_difference(vocabulary_faqs)
10- set([])
11+ >>> for item in firefox_faqs.symmetric_difference(vocabulary_faqs):
12+ ... print(item)
13
14 And it only contains FAQs:
15
16diff --git a/lib/lp/app/widgets/doc/checkbox-matrix-widget.txt b/lib/lp/app/widgets/doc/checkbox-matrix-widget.txt
17index a2dbd20..ad6cf7f 100644
18--- a/lib/lp/app/widgets/doc/checkbox-matrix-widget.txt
19+++ b/lib/lp/app/widgets/doc/checkbox-matrix-widget.txt
20@@ -33,10 +33,14 @@ as a set from _getFormValue() or getInputValue():
21 >>> request = LaunchpadTestRequest(
22 ... form={'field.licenses': ['GNU_LGPL_V2_1', 'GNU_GPL_V2']})
23 >>> matrix_widget = CheckBoxMatrixWidget(licenses_field, vtype, request)
24- >>> matrix_widget._getFormValue()
25- set([<...License.GNU_GPL_V2...>, <...License.GNU_LGPL_V2_1...>])
26- >>> matrix_widget.getInputValue()
27- set([<...License.GNU_GPL_V2...>, <...License.GNU_LGPL_V2_1...>])
28+ >>> for item in sorted(matrix_widget._getFormValue()):
29+ ... print(repr(item))
30+ <...License.GNU_GPL_V2...>
31+ <...License.GNU_LGPL_V2_1...>
32+ >>> for item in sorted(matrix_widget.getInputValue()):
33+ ... print(repr(item))
34+ <...License.GNU_GPL_V2...>
35+ <...License.GNU_LGPL_V2_1...>
36
37 It should render as many rows as are specified by the column_count attribute.
38
39diff --git a/lib/lp/archiveuploader/tests/nascentuploadfile.txt b/lib/lp/archiveuploader/tests/nascentuploadfile.txt
40index 3bb1a25..a8e53af 100644
41--- a/lib/lp/archiveuploader/tests/nascentuploadfile.txt
42+++ b/lib/lp/archiveuploader/tests/nascentuploadfile.txt
43@@ -95,8 +95,9 @@ At this point the changesfile content is already parsed:
44 >>> ed_binary_changes.version
45 '0.2-20'
46
47- >>> ed_binary_changes.architectures
48- set(['i386'])
49+ >>> for item in ed_binary_changes.architectures:
50+ ... print(item)
51+ i386
52
53 >>> ed_binary_changes.suite_name
54 'unstable'
55diff --git a/lib/lp/bugs/doc/bug-tags.txt b/lib/lp/bugs/doc/bug-tags.txt
56index 8448b71..366d1cd 100644
57--- a/lib/lp/bugs/doc/bug-tags.txt
58+++ b/lib/lp/bugs/doc/bug-tags.txt
59@@ -201,15 +201,18 @@ _tagsToFieldValue() converts the tags entered in the form into a value
60 suitable for the field. In the absense of tags it returns an empty
61 frozenset():
62
63- >>> tags_frozen_set_widget._tagsToFieldValue(None)
64- frozenset([])
65- >>> tags_frozen_set_widget._tagsToFieldValue([])
66- frozenset([])
67+ >>> for item in tags_frozen_set_widget._tagsToFieldValue(None):
68+ ... print(item)
69+ >>> for item in tags_frozen_set_widget._tagsToFieldValue([]):
70+ ... print(item)
71
72 Otherwise it returns a `frozenset` of the tags given:
73
74- >>> tags_frozen_set_widget._tagsToFieldValue([u"foo", u"bar"])
75- frozenset([u'foo', u'bar'])
76+ >>> for item in sorted(tags_frozen_set_widget._tagsToFieldValue(
77+ ... [u"foo", u"bar"])):
78+ ... print(item)
79+ bar
80+ foo
81
82
83 Large and Small Bug Tags Widget
84diff --git a/lib/lp/bugs/doc/product-update-remote-product.txt b/lib/lp/bugs/doc/product-update-remote-product.txt
85index 096375a..4491245 100644
86--- a/lib/lp/bugs/doc/product-update-remote-product.txt
87+++ b/lib/lp/bugs/doc/product-update-remote-product.txt
88@@ -82,9 +82,9 @@ it's skipped as well.
89
90 >>> updater = TrackerTypeCollectingUpdater()
91 >>> updater.update()
92- >>> multi_product_trackers.symmetric_difference(
93- ... updater.looped_over_bug_tracker_types)
94- set([])
95+ >>> for item in multi_product_trackers.symmetric_difference(
96+ ... updater.looped_over_bug_tracker_types):
97+ ... print(item)
98
99
100 updateByBugTrackerType()
101diff --git a/lib/lp/registry/browser/tests/milestone-views.txt b/lib/lp/registry/browser/tests/milestone-views.txt
102index 6747dda..5e92fde 100644
103--- a/lib/lp/registry/browser/tests/milestone-views.txt
104+++ b/lib/lp/registry/browser/tests/milestone-views.txt
105@@ -216,8 +216,9 @@ release as a set.
106
107 >>> ignored = login_person(person)
108 >>> view = create_view(milestone, '+index')
109- >>> view.getReleases()
110- set([<ProductRelease ...>])
111+ >>> for release in view.getReleases():
112+ ... print(repr(release))
113+ <ProductRelease ...>
114
115 >>> [release.version for release in view.getReleases()]
116 [u'kakapo']
117diff --git a/lib/lp/registry/doc/person.txt b/lib/lp/registry/doc/person.txt
118index 11abc90..51e83da 100644
119--- a/lib/lp/registry/doc/person.txt
120+++ b/lib/lp/registry/doc/person.txt
121@@ -642,8 +642,9 @@ team will go to that address.
122 u'support@ubuntu.com'
123
124 >>> from lp.services.mail.helpers import get_contact_email_addresses
125- >>> get_contact_email_addresses(ubuntu_team)
126- set(['support@ubuntu.com'])
127+ >>> for email in get_contact_email_addresses(ubuntu_team):
128+ ... print(email)
129+ support@ubuntu.com
130
131 On the other hand, if a team doesn't have a contact email address, all
132 notifications we send to the team will go to the preferred email of each
133diff --git a/lib/lp/registry/doc/product-widgets.txt b/lib/lp/registry/doc/product-widgets.txt
134index dd2e6c5..e08d8d8 100644
135--- a/lib/lp/registry/doc/product-widgets.txt
136+++ b/lib/lp/registry/doc/product-widgets.txt
137@@ -327,8 +327,9 @@ One licence, the GNU GPL v2, is selected.
138 ... else:
139 ... print
140
141- >>> license_widget.getInputValue()
142- set([<DBItem License.GNU_GPL_V2, (130) ...>])
143+ >>> for item in license_widget.getInputValue():
144+ ... print(repr(item))
145+ <DBItem License.GNU_GPL_V2, (130) ...>
146
147 >>> print_checked_items(license_widget())
148 [ ] Apache Licence ...
149diff --git a/lib/lp/services/mail/tests/incomingmail.txt b/lib/lp/services/mail/tests/incomingmail.txt
150index 3982bb1..f9fb29f 100644
151--- a/lib/lp/services/mail/tests/incomingmail.txt
152+++ b/lib/lp/services/mail/tests/incomingmail.txt
153@@ -108,10 +108,10 @@ header is missing.)
154
155 Now we can see that each handler handled the emails sent to its domain:
156
157- >>> set(foo_handler.handledMails) ^ set(msgids['foo.com'])
158- set([])
159- >>> set(bar_handler.handledMails) ^ set(msgids['bar.com'])
160- set([])
161+ >>> for item in set(foo_handler.handledMails) ^ set(msgids['foo.com']):
162+ ... print(item)
163+ >>> for item in set(bar_handler.handledMails) ^ set(msgids['bar.com']):
164+ ... print(item)
165
166 --------------
167 Unhandled Mail
168diff --git a/lib/lp/soyuz/doc/gina.txt b/lib/lp/soyuz/doc/gina.txt
169index 7c60af4..0377498 100644
170--- a/lib/lp/soyuz/doc/gina.txt
171+++ b/lib/lp/soyuz/doc/gina.txt
172@@ -668,17 +668,23 @@ There will now be a number of publishings in the partner archive:
173 All the publishings will also have the 'partner' component and the
174 partner archive:
175
176- >>> print(set(sspph.component.name for sspph in source_difference))
177- set([u'partner'])
178+ >>> for name in set(sspph.component.name for sspph in source_difference):
179+ ... print(name)
180+ partner
181
182- >>> print(set(sbpph.component.name for sbpph in binary_difference))
183- set([u'partner'])
184+ >>> for name in set(sbpph.component.name for sbpph in binary_difference):
185+ ... print(name)
186+ partner
187
188- >>> print(set(sspph.archive.purpose.name for sspph in source_difference))
189- set(['PARTNER'])
190+ >>> for name in set(
191+ ... sspph.archive.purpose.name for sspph in source_difference):
192+ ... print(name)
193+ PARTNER
194
195- >>> print(set(sbpph.archive.purpose.name for sbpph in binary_difference))
196- set(['PARTNER'])
197+ >>> for name in set(
198+ ... sbpph.archive.purpose.name for sbpph in binary_difference):
199+ ... print(name)
200+ PARTNER
201
202
203 Source-only imports
204@@ -754,8 +760,9 @@ targetted distroseries, 'lenny'.
205 >>> lenny_sources.count()
206 12
207
208- >>> print(set([pub.status.name for pub in lenny_sources]))
209- set(['PUBLISHED'])
210+ >>> for name in set([pub.status.name for pub in lenny_sources]):
211+ ... print(name)
212+ PUBLISHED
213
214 As mentioned before, lenny/i386 is empty, no binaries were imported.
215 Also, the number of binaries published in the whole debian distribution
216diff --git a/lib/lp/soyuz/doc/sourcepackagerelease.txt b/lib/lp/soyuz/doc/sourcepackagerelease.txt
217index 8bf8a31..4dc4558 100644
218--- a/lib/lp/soyuz/doc/sourcepackagerelease.txt
219+++ b/lib/lp/soyuz/doc/sourcepackagerelease.txt
220@@ -77,8 +77,9 @@ property only returns the non-PPA builds.
221
222 All the builds returned are for non-PPA archives:
223
224- >>> set(build.archive.purpose.name for build in spr.builds)
225- set(['PRIMARY'])
226+ >>> for item in set(build.archive.purpose.name for build in spr.builds):
227+ ... print(item)
228+ PRIMARY
229
230 Check that the uploaded changesfile works:
231

Subscribers

People subscribed via source and target branches

to status/vote changes: